vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Administrative and Maintenance Tools - Only SuperAdmin Can Add New Admin (https://vborg.vbsupport.ru/showthread.php?t=75696)

tnguy3n 02-03-2005 10:00 PM

Only SuperAdmin Can Add New Admin
 
Modded by tnguy3n @ http://www.all4actions.net

Description:
This mod allows only super adminstrator to add a new admin or modifying an existing user to become admin.
This mod is useful for forums that have more than one admin or user groups that have access to admin cp and you don't want normal admin to add new admin or modify/promote a user to an admin group (or any group you assigned).

Installation time: 1-2 mins (easy)
File mod: 1
1 new phrase

Note:
- change value 1 in $superadmin to your own userid.
- if you have more than 1 super admin, you can use array to do the trick. ;)

yoyoyoyo 02-04-2005 02:41 AM

very timely! :) THANKS!

Megareus Rex 02-04-2005 02:46 AM

Cool hack idea. But I have a couple questions.

I added my user id into the $superadmin variable, but it still gives me the no permission message. Is that supposed to happen?

tnguy3n 02-04-2005 02:50 AM

Quote:

Originally Posted by Megareus Rex
Cool hack idea. But I have a couple questions.

I added my user id into the $superadmin variable, but it still gives me the no permission message. Is that supposed to happen?

if you'r the only super admin, you can use this code instead
Code:

// only super admin can add admin (and/or smod)
        $cant_add_groups = array(5,6); // use comma to seperate usergroups
        if (($bbuserinfo['userid'] != '1') AND in_array($user['usergroupid'], $cant_add_groups))
        {
                print_stop_message('cant_add_admin');
        }

and I assumed your userid is 1 .

Megareus Rex 02-04-2005 06:57 AM

Quote:

Originally Posted by tnguy3n
if you'r the only super admin, you can use this code instead
Code:

// only super admin can add admin (and/or smod)
        $cant_add_groups = array(5,6); // use comma to seperate usergroups
        if (($bbuserinfo['userid'] != '1') AND in_array($user['usergroupid'], $cant_add_groups))
        {
                print_stop_message('cant_add_admin');
        }

and I assumed your userid is 1 .

Actually no, there are 2 s-admins. So, what would I do then?

tnguy3n 02-04-2005 10:11 AM

then using this code:
PHP Code:

// only super admin can add admin (and/or smod)
    
$cant_add_groups = array(5,6); // use comma to seperate usergroups
    
$superadmins = array(1,2); // use comma to seperate more sadmin
    
if (!in_array($bbuserinfo['userid'], $superadmins) AND in_array($user['usergroupid'], $cant_add_groups))
    {
        
print_stop_message('cant_add_admin');
    } 


Megareus Rex 02-05-2005 06:11 AM

Thank you lots!!! It works perfectly now!

Not that I don't trust the other admin, but I like security...lol. >.>

Carnage 02-07-2005 11:47 AM

i notice a slight problem with this... whats to stop the admin adding the 'admin' group as a member group of the user? Something else thats along this line, could we prevent normal admins from editing access masks to certain forums? ie the super admin only forum?

Delphiprogrammi 02-08-2005 04:09 PM

what you ask is a standard feature you have to be superadmin to edit admininistrator permissions

also people be VERRY CAREFULL with giving super admin a super admin is like root on linux he cando anything he likes .... forumpermissions can be set seperatly ...

Carnage 02-08-2005 07:01 PM

Quote:

Originally Posted by Delphiprogrammi
what you ask is a standard feature you have to be superadmin to edit admininistrator permissions

also people be VERRY CAREFULL with giving super admin a super admin is like root on linux he cando anything he likes .... forumpermissions can be set seperatly ...

incorrect. superadmins are the only ones who can give admin PERMISSIONS however regular admins can move other users into the admin usergroup.

What i'm wondering is if theres anyway to make a superadmin forum that normal admins cannot see or grant access to. I also want to make a superadmin only ugroup for purposes of the show groups page... this would work but it dosn't check againt member groups...


All times are GMT. The time now is 05:59 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.02517 seconds
  • Memory Usage 1,737KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete