View Full Version : Administrative and Maintenance Tools - Only SuperAdmin Can Add New Admin
tnguy3n
02-03-2005, 10:00 PM
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
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
// 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
if you'r the only super admin, you can use this code instead
// 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:
// 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
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...
Delphiprogrammi
02-08-2005, 07:53 PM
true but i can't think of any reason why you would want todo that
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.