PDA

View Full Version : [Mini-Hack] Protect Admins in the Admin CP.


Slynderdale
15 Jan 2003, 19:46
This is just a mini-hack I made, I know theres others like it, but this one is simple and protects admins from being edited, deleted, editing access masks and so on and the options can be changed in config.php, heres the current options:


// which users are allowed to edit the admin usernames
$caneditadmin = "all";
// if they cant edit admins, can they edit them selves?
$caneditadminself = true;

// admins that are protected from others editing them
$protectedadmins = "1";
// can the protected admins edit them selves?
$protectedadminsself = true;


Its pretty much self explanatory, if a unathorized admin tries to edit, delete and so on an admin, they get an error message saying there not allowed to do that.

With the option $caneditadmin, you can control what admins can edit other admins.
With the option $caneditadminself, if set to true, the admin can edit there own account even if there not listed in caneditadmin.

With the option $protectedadmins, no other admin can edit them even of there listed in caneditadmin, this is good for protecting a main admin account from being tampered with.
With the option $protectedadminsself, if set to true, it allows the protected admins to edit there own account.

The $caneditadmin and $protectedadmins can support multiple accounts, each account must be seperated with a comma for example:
$caneditadmin = "1,2,3,6";
or you can use "all" for every admin, for example:
$caneditadmin = "all";

The $caneditadminself and $protectedadminsself can be set to true, if the admin can edit there own account or false if they cant.

ManagerJosh
16 Jan 2003, 08:12
Excellent! I was looking for a replacement for Chen's modified version! :)

*clicks install*

w596
16 Jan 2003, 09:08
In your txt file you say...

-------------------------------------
| In admin/config.php find: |
-------------------------------------

?>

-------------------------------------
| above it add: |
-------------------------------------

// which users are allowed to edit the admin usernames
$caneditadmin = "all";
// if they cant edit admins, can they edit them selves?
$caneditadminself = true;

// admins that are protected from others editing them
$protectedadmins = "1";
// can the protected admins edit them selves?
$protectedadminsself = true;


Did you actually mean to say below it add:?

LOL see the next two posts... Thanks for straightening me out scsa20 :D


BTW it works perfectly. ;)

Thanks,
W596

scsa20
16 Jan 2003, 09:35
no, it's correct, you so'pose to add it above ?>, otherwise it'll just think it's normal text in normal HTML

btw... nice hack, need to install this later :)

w596
16 Jan 2003, 10:42
LMAO!!!

My Bad... I think maybe I'm dyslexic, I seen it as <?
doh! :)
:p

HHTKAO
18 Jan 2003, 07:38
This is great, im definitly adding this. nice hack :)

Katana Myronson
08 Feb 2003, 20:00
Great hack.... its going on to my list of hacks. :)

Sam FT
15 Jun 2003, 22:30
This is an awesome hack. I had the Total Admin Security by hellsatan for keeping any one from deleting my account. But this is even better with the abiltiy to keep other admins from edit each other.

Chris M
16 Jun 2003, 14:14
Yesterday at 11:30 PM Music Pirate said this in Post #8 (http://www.vbulletin.org/forum/showthread.php?postid=409362#post409362)
This is an awesome hack. I had the Total Admin Security by hellsatan for keeping any one from deleting my account. But this is even better with the abiltiy to keep other admins from edit each other.

Heh - Total Admin Security can easily be modified to perform the same function;)

Satan