Actions

J1.5 talk

Custom user groups

From Joomla! Documentation

Revision as of 03:12, 15 April 2009 by Hunny (Talk | contribs)

For displaying the groups correctly you will have to change the code of : /administrator/components/com_users/admin.users.php line 285:

if ( $userGroupName == $myGroupName && $myGroupName == 'administrator' )

  {
     // administrators can't change each other
     $lists['gid'] = '<input type="hidden" name="gid" value="'. $user->get('gid') .'" />'. JText::_( 'Administrator' ) .'';
  }
  else
  {
     $gtree = $acl->get_group_children_tree( null, 'USERS', false );into 

if ( $userGroupName == $myGroupName && $myGroupName == 'administrator' )

  {
     // administrators can't change each other
     $lists['gid'] = '<input type="hidden" name="gid" value="'. $user->get('gid') .'" />'. JText::_( 'Administrator' ) .'';
  }
  else
  {
     $gtree = $acl->get_group_children_tree( null, 'USERS', true);

I use Joomla 1.5.7 and I don't have the /administrator/components/com_users/admin.users.php file. (at least in that address)


I am on my first try too, and I found the call in

../administrator/components/com_users/views/user/view.html.php

on Line 113 (in a J- 1.5.8 wich is patched to a 1.5.9)


Here is a more detailed explanation of my problem I’m running joomla 1.5.9 under windows(test) and linux(production). Using instructions provided here http://docs.joomla.org/Custom_user_groups (this same instruction has been repeateed on countless other websites)

This is what I’ve done on my test windows box

1. edited line 113 of \administrator\components\com_users\views\user\view.html.php, changing from : $gtree = $acl->get_group_children_tree( null, 'USERS', false); to : $gtree = $acl->get_group_children_tree( null, 'USERS', true );

2. I added new group to jos_core_acl_aro_groups, say NGrp, parent_id=18 as Registered group’s id=18. I got NGrp’s id=31

3. I run rebuild.php and got lft=12, rgt=13 for NGrp group

4. I added NGrp to jos_groups, id=3, name=NGrp

5. I created new user, say NUser and assigned it to NGrp group. NGrp group which, based on the visual clues of the select , is at the same level as Author group?? - Users         Public Front-end       . - Registered       .        Author       .       . - Editor       .       .       - Publisher       .       - NGrp       -  Public Back-end             - Manager                   - Administrator                         - Super Administrator

6. The NGrp only appears as selectable under Menus ?? (can live with this unless anyone can suggest a solution?) Changed access an existing menu item, say Nmenu from Registered to NGrp

8. Logged in as NUser, I went to click on the Nmenu item- it's not visible to me (or any other type of user - not even publisher)

Well, something is wrong… The question is, what am I doing wrong? AND what is the function of lft and rgt in the jos_core_acl_aro_groups table?