vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Restrict Usergroup Changing in the CP (https://vborg.vbsupport.ru/showthread.php?t=53099)

Robert9 05-18-2003 08:20 PM

Restrict Usergroup Changing in the CP
 
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:
PHP Code:

makechoosercode("User Group","usergroupid","usergroup",$user[usergroupid]); 

Replace that with:
PHP Code:

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:
PHP Code:

if ($bbuserinfo[usergroupid]==X) {makechoosercode("User Group","usergroupid","usergroup",$user[usergroupid]);} 

With
PHP Code:

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 .


All times are GMT. The time now is 02:02 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01126 seconds
  • Memory Usage 1,716KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete