11
Codyko
Re: Use of $gperm_handler->checkRight ?
  • 2005/11/4 4:12

  • Codyko

  • Just popping in

  • Posts: 22

  • Since: 2005/8/5 7


Here is additional information of my question:

A screen shot of the content of xoops_group_permission table

[pre]
mysqlselect from xoops_group_permission where gperm_modid AND gperm_groupid =AND gperm_itemid 3;
+----------+---------------+--------------+-------------+--------------+
gperm_id gperm_groupid gperm_itemid gperm_modid gperm_name   |
+----------+---------------+--------------+-------------+--------------+
|      
363 |             |            |           xclinic_view |
|      
408 |             |            |           xclinic_add  |
+----------+---------------+--------------+-------------+--------------+
2 rows in set (0.00 sec)

[/
pre]


I suppose the following codes could check access rights of "ANONYMOUS" group correctly, since I have an entry "3" ( groupid of anonymous ) in thegperm_groupid :
[pre]
$perm_name "xclinic_view";
$perm_itemid 3
$groups is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;

$module_id $xoopsModule->getVar('mid');
$gperm_handler = & xoops_gethandler('groupperm');

if (!
$gperm_handler->checkRight($perm_name$perm_itemid$groups$module_id)) {
    
redirect_header("index.php"2_MD_NOACCESSRIGHTS);
    exit();
} else { 
//some actions here }

[/pre]


but it still redirects me to index.php if I visit the page as anonymous user



12
Codyko
Use of $gperm_handler->checkRight ?
  • 2005/11/4 3:42

  • Codyko

  • Just popping in

  • Posts: 22

  • Since: 2005/8/5 7


Hi!

I asked a question regarding group permission in my clinic module in the post :

https://xoops.org/modules/newbb/viewtopic.php?topic_id=12230&start=20#forumpost187979

I found the answers by self. But now I have another question that I could not find answers in other threads.

Ok, I have implemented an admin page which controls group permissions of my module. I can see that it adds entries to the "group_permission" table smoothly.

My problem is that following code could not grant access rights to "anonymous group" although I have appropriatly granted permissions to this group in the admin page :

$gperm_handler->checkRight($perm_name, $perm_itemid, $groups, $module_id)

However, it can correctly check access rights of other groups , which are granted in the admin page.

Any idea ?



13
Codyko
Re: Adding the group permission feature to your module
  • 2005/11/4 3:26

  • Codyko

  • Just popping in

  • Posts: 22

  • Since: 2005/8/5 7


Hi!

>>>>>I am developing a clinic module which has the current basic functions:

I found the answers by myself that I should use a array to store the elements in $item_list since the functional areas of my clinic module is somewhat logical , containing no ids in database tables:

$item_list = array('1' => _AM_XCLINIC_ALLABOUTPATIENT,
'2' => _AM_XCLINIC_ALLABOUTMEDICINE,
'3' => _AM_XCLINIC_DIAGNOSIS_RECORDS,
'4' => _AM_XCLINIC_APPOINTMENTS
);

Thanks!

Regards
Cody



14
Codyko
Re: Adding the group permission feature to your module
  • 2005/11/1 3:59

  • Codyko

  • Just popping in

  • Posts: 22

  • Since: 2005/8/5 7


Hi,

I am developing a clinic module which has the current basic functions:
1. Patient Profile
2. Medications
3. Appointment
4. Consulatation

Actions like add,remove, edit could be done on the these functional areas.For security reason, I want to apply group permissions to the module.

As stated in the first post, the "list of items that we will be setting permissions to" should be retrieved in DB.
However, in my case, I don't need permissions setting on individual record of each function type; For example, I want to control who can add/remove patients' profile but no control on individual profile.

So do i need to create an EXTRA table storing the function type ( ie func1 => "Patient Profile", func2 = "Medications") and then apply group permission just like what's stated in the first post?

Any idea is welcome! Thank You!

Cody



15
Codyko
Re: How to use "$xTheme->loadModuleAdminMenu" ?
  • 2005/10/31 8:37

  • Codyko

  • Just popping in

  • Posts: 22

  • Since: 2005/8/5 7


Ok, I 've just found the answers myself. Here are what I learned :
1. Contents of the module's menu/navigation bar must be defined correctly in admin/menu.php :
$i=1;
$adminmenu[$i]['title'] = _MODULE_MI_INDEX;
$adminmenu[$i++]['link'] = "admin/index.php";
$adminmenu[$i]['title'] = _MODULE_MI_PERMISSION;
$adminmenu[$i++]['link'] = "admin/perm.php";



which must in turn defined correctly in xoops_version.php :

// Admin things
$modversion['hasAdmin'] = 1;
$modversion['adminindex'] = "admin/index.php";
$modversion['adminmenu'] = "admin/menu.php";


2. The above setting must be defined correctly "BEFORE" installing your module. This is the step I had problem ; When I created admin menu/navi bar, I had already installed the module for developing.

Hope it helps others



16
Codyko
How to use "$xTheme->loadModuleAdminMenu" ?
  • 2005/10/31 7:46

  • Codyko

  • Just popping in

  • Posts: 22

  • Since: 2005/8/5 7


Hi,

I am a newbie in developing XOOPS module.
For the admin page, I found in the 2.2 API doc that we can "Creates a pretty menu and navigation bar above your module admin pag" by using

$xTheme->loadModuleAdminMenu(1)

Ok, with reference to admin.php of profile module and dev wiki, I suppose there is such a menu bar by using the following codes in my admin/index.php :

include '../../../include/cp_header.php';
xoops_cp_header();

$xTheme->loadModuleAdminMenu(1);

xoops_cp_footer();




Unluckily, I could only see a plain system admin page like this :
Resized Image

Any idea ? Thank You!



17
Codyko
Re: Highlighting Sub-albums in Xoopsgallery
  • 2005/8/12 1:53

  • Codyko

  • Just popping in

  • Posts: 22

  • Since: 2005/8/5 7


@skenow

Thanks for you reply.

I tried to register and report this problem to xoopsgallery.org but unluckily, I haven't received any activation mail from them. Sigh!

By the way, I hope Gallery2 to be final soon so that we will have a new xoopsgallery module, hopefully!



18
Codyko
Highlighting Sub-albums in Xoopsgallery
  • 2005/8/11 13:58

  • Codyko

  • Just popping in

  • Posts: 22

  • Since: 2005/8/5 7


Hi!

I am using XOOPS 2.0.13 and xoopsgallery 1.3.3.7 and I have problem with the highlighting feature of the gallery module :

Now, I have album structure as below :

Album 1
|----Album 2
| |--Album5
| | |---Pic1
| |
| |--Album7
| | |---Pic2
| |
| |--Album9
| |---Pic1
|
|
|----Album 3
| |--Album6
| | |---Pic1
| |
| |--Album8
| |---Pic1
| |---Pic2

Ok, I can highlight any "Picture" for an album but I CANNOT choose which sub-album to be highlighted for its parent album; Instead, the "first" sub-album is always higlighted.
In my case, for example, album 5 is always highlighted for album 2 , no matter I choose Album7 or Album9 as highlighted. The same happens in Album3.

Unluckily, there is no error message though I turn on debug mode.
Any idea ? Thank YOu!

Regards
Cody



19
Codyko
Questions about Character Encoding
  • 2005/8/5 8:31

  • Codyko

  • Just popping in

  • Posts: 22

  • Since: 2005/8/5 7


Hi fellow xoopsers !

I have some questions about character encoding in xoops.

I am a user of Traditional Chinese version of XOOPS which is equipped with "big-5" encoded "tchinese" language packs. Recently, when I tried to integrate Gallery 2 into my website, I got strange characters displayed on my pages. After searching posts in Gallery's forum, I found it's caused by a conflict between the "utf-8" encoded Gallery 2 and my XOOPS site.

This make me think of the questions of character encoding. So besides language packs, do we need to add some special handling in the php files in order to support different character encodings ?

Moreover, can I directly apply the update patches released by xoops.org instead of those by our local support sites ?

Thank You very much !




TopTop
« 1 (2)



Login

Who's Online

267 user(s) are online (184 user(s) are browsing Support Forums)


Members: 0


Guests: 267


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits