PDA

View Full Version : How to check User permissions in user.php


Zaulael
08-14-2013, 05:30 AM
Hello,

I'm trying to make a modification in user.php (/admincp/user.php) so that only Super Admins can delete users. Now, forgive me, I'm not very familiar with how to check if the current USER (not the current USERID you're looking it) is a Super Admin, or of a certain userid.

So far, I have:

if ($vbulletin->GPC['userid'] == 5)
{
$quicklinks["user.php?" . $vbulletin->session->vars['sessionurl'] . "do=remove&u=" . $vbulletin->GPC['userid']] = $vbphrase['delete_user'];
}


As you may have guessed, this doesn't work.

Anyone have any suggestions for a beginner vbulletin editor/modder?

Thanks in advance!

Zachery
08-14-2013, 06:28 AM
So, I know you want to improve security, but can your other admins use plugins? Run SQL queries? Modify Admin permissions? Modify templates, phrases, user titles, etc?

kh99
08-14-2013, 08:52 AM
I think what you want is:

if (is_member_of($vbulletin->userinfo, 5))

Zaulael
08-14-2013, 11:10 AM
So, I know you want to improve security, but can your other admins use plugins? Run SQL queries? Modify Admin permissions? Modify templates, phrases, user titles, etc?

No, but they can approve users and change to necessary user groups. I can tell them till I'm blue in the face not to delete a user but it always happens eventually :)

Thanks kh99, I'll see if that works when I get home.