PDA

View Full Version : Restrict Usergroup Changing in the CP


Robert9
05-18-2003, 08:20 PM
I figured this would be useful for forums that don't want other admins to constantly move or change people's usergroups in the admin CP.

What it does:
It makes it so only a certain usergroup or user can view the usergroup drop down box when editing a user in the admin CP.

Step 1:
Open up admin/user.php and find:
makechoosercode("User Group","usergroupid","usergroup",$user[usergroupid]);
Replace that with:
if ($bbuserinfo[usergroupid]==X) {makechoosercode("User Group","usergroupid","usergroup",$user[usergroupid]);}
Replace X with whatever usergroup you wish and your DONE!
If you want to restrict it to a user, just replace:
if ($bbuserinfo[usergroupid]==X) {makechoosercode("User Group","usergroupid","usergroup",$user[usergroupid]);}
With
if ($bbuserinfo[userid]==X) {makechoosercode("User Group","usergroupid","usergroup",$user[usergroupid]);}

I'm currently working on how to remove selected usergroups from the dropdown. If anybody has an idea of how, please post it.

Dean C
05-19-2003, 02:26 PM
This has been done several times before...

- miSt

Xenon
05-19-2003, 06:51 PM
Dean is right, that was done several times

If you take a look at my mods can edit users you can see also a modified code for just allow several usergroups in the chooser, not all possible.

and no, you can't use it to release another hack, but if you need it for yourself feel free to take the code .