Actions

J1.5 talk

Difference between revisions of "Custom user groups"

From Joomla! Documentation

m (Wilsonge moved page Talk:Custom user groups to J1.5 talk:Custom user groups: Add to 1.5 namespace)
 
(14 intermediate revisions by 5 users not shown)
Line 61: Line 61:
  
 
6. The NGrp only appears as selectable under Menus ?? (can live with this unless anyone can suggest a solution?)
 
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
+
Changed access to 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)
 
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)
Line 67: Line 67:
 
Well, something is wrong… The question is, what am I doing wrong?
 
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?
 
AND what is the function of lft and rgt in the jos_core_acl_aro_groups table?
 +
 +
== Source script error? ==
 +
 +
Hey, I think the php source provided to rebuild the lft and rgt values is wrong.
 +
 +
If you run it against the un-modified jos_core_acl_aro_user_groups table, you will find that the values assigned are different from the original values.
 +
 +
The problem appears to be in the first call to rebuild_tree:
 +
rebuild_tree ( 0 , 1);
 +
 +
If you change this to
 +
rebuild_tree ( 0 , 0);
 +
 +
Then run it against the original jos_..._groups table, the values remain as they were originally.
 +
 +
Not sure if it fixes anything though!
 +
 +
== One more trick... ==
 +
 +
(Using Joomla 1.5.14)
 +
If you allow new registrations and want those newly registered users to go into one of your newly created custom groups, you would set this on the Global Configuration/System Tab, under "User Settings".  The problem is that the original options of Registered/Author/Editor/Publisher are the only values available in the drop down list.
 +
 +
To fix that, edit the file <joomla root>\administrator\components\com_users\config.xml.
 +
 +
In my case, I am setting up a site which needs to provide additional content to verified users (members of a club.)  So I've added them like so:
 +
 +
  <param name="new_usertype" type="list" default="Registered" label="New User Registration Type" description="TIPNEWUSERTYPE">
 +
  <option value="Registered">Registered</option>
 +
  '''''<option value="Members">Members</option>'''''
 +
  <option value="Author">Author</option>
 +
  <option value="Editor">Editor</option>
 +
  <option value="Publisher">Publisher</option>
 +
  </param>
 +
 +
The ''value'' needs to match what you have inserted into jos_core_acl_aro_groups (not sure which column - name or value - but *personally* I'd suggest they are both the same anyway!)
 +
 +
== Problem under Joomla! 1.5.15 and GMAccess 5.15... ==
 +
The new groups aren't displayed on Joomla! 1.5.15 : in the backend, when you edit an user, you can only see the commun groups provided by Joomla!.
 +
But the "jos_core_acl_aro_groups" table is correctly modified by the php script.
 +
 +
However, the new groups are displayed in Community Builder 1.2 .
 +
 +
The problem came from the component GMAccess which also hackes the Joomla! code : This component modifies the file "/administrator/components/com_users/views/user/view.html.php"
 +
 +
Sorry for the noise.
 +
 +
== Need more documentation on rebuild_tree() ==
 +
<ol>
 +
<li>I created a new group under registered.</li>
 +
<li>Did not assign lft or rgt values.</li>
 +
<li>assigned parent_id=18</li>
 +
<li>Then I ran rebuild_tree(0,1) as it shows in the doc</li>
 +
</ol>
 +
 +
All the lft and rgt numbering is messed up. Their are duplicates and their is no order at all.
 +
 +
Whoever wrote the original doc needs to clearly explain what this function does and how to use.
 +
 +
If im changing a child node then the very top root has to be changed also. So do not know what else to put for first parameter besides 0.
 +
 +
How does this function know what order to place the new group within the same node level?
 +
 +
== Do not see this bug in 1.5.11 ==
 +
 +
This looks more like a bug report and how to fix it.
 +
 +
== I've seen this thread but my issue unresolved. ==
 +
 +
hi all
 +
I've seen this thread but my issue unresolved.
 +
please help me.
 +
i have joomla 1.5.25 [http://POLNET.IR]

Latest revision as of 08:05, 5 June 2013

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 repeated 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 to 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?

Contents

Source script error?

Hey, I think the php source provided to rebuild the lft and rgt values is wrong.

If you run it against the un-modified jos_core_acl_aro_user_groups table, you will find that the values assigned are different from the original values.

The problem appears to be in the first call to rebuild_tree: rebuild_tree ( 0 , 1);

If you change this to rebuild_tree ( 0 , 0);

Then run it against the original jos_..._groups table, the values remain as they were originally.

Not sure if it fixes anything though!

One more trick...

(Using Joomla 1.5.14) If you allow new registrations and want those newly registered users to go into one of your newly created custom groups, you would set this on the Global Configuration/System Tab, under "User Settings". The problem is that the original options of Registered/Author/Editor/Publisher are the only values available in the drop down list.

To fix that, edit the file <joomla root>\administrator\components\com_users\config.xml.

In my case, I am setting up a site which needs to provide additional content to verified users (members of a club.) So I've added them like so:

 <param name="new_usertype" type="list" default="Registered" label="New User Registration Type" description="TIPNEWUSERTYPE">
  <option value="Registered">Registered</option>
  <option value="Members">Members</option>
  <option value="Author">Author</option>
  <option value="Editor">Editor</option>
  <option value="Publisher">Publisher</option>
 </param>

The value needs to match what you have inserted into jos_core_acl_aro_groups (not sure which column - name or value - but *personally* I'd suggest they are both the same anyway!)

Problem under Joomla! 1.5.15 and GMAccess 5.15...

The new groups aren't displayed on Joomla! 1.5.15 : in the backend, when you edit an user, you can only see the commun groups provided by Joomla!. But the "jos_core_acl_aro_groups" table is correctly modified by the php script.

However, the new groups are displayed in Community Builder 1.2 .

The problem came from the component GMAccess which also hackes the Joomla! code : This component modifies the file "/administrator/components/com_users/views/user/view.html.php"

Sorry for the noise.

Need more documentation on rebuild_tree()

  1. I created a new group under registered.
  2. Did not assign lft or rgt values.
  3. assigned parent_id=18
  4. Then I ran rebuild_tree(0,1) as it shows in the doc

All the lft and rgt numbering is messed up. Their are duplicates and their is no order at all.

Whoever wrote the original doc needs to clearly explain what this function does and how to use.

If im changing a child node then the very top root has to be changed also. So do not know what else to put for first parameter besides 0.

How does this function know what order to place the new group within the same node level?

Do not see this bug in 1.5.11

This looks more like a bug report and how to fix it.

I've seen this thread but my issue unresolved.

hi all I've seen this thread but my issue unresolved. please help me. i have joomla 1.5.25 [1]