View Full Version : [Tip] Be the super admin, but protect yourself!


Floris
14th November 2004, 08:24 PM
When you run version 3.0.x of vBulletin you might want to secure your forum by making yourself an undeletable user. But if you are also the site owner, you might want to be the super admin, and the only one with debug powers! Here is how:

Open the config.php file and find the variables $undeletableusers and $superadministrators and set the userid for yourself. Usually if you own the site, the userid is 1. You find your userid by going to the who is online and hover over your own username, you will see in the status bar of your browser an url that ends with a number, that number is the userid.

// ****** UNDELETABLE / UNALTERABLE USERS ******
// The users specified here will not be deletable or alterable from the control panel by any users.
// To specify more than one user, separate userids with commas.
$undeletableusers = '1';

// ****** SUPER ADMINISTRATORS ******
// The users specified below will have permission to access the administrator permissions
// page, which controls the permissions of other administrators
$superadministrators = '1';

The above example shows how to set this to 1 properly.
Now, below the variable $superadministrators you can add the following code to turn on debug, but limit it to your own account only.

if ($_SERVER['REMOTE_ADDR'] == '123.123.123.123')
{
$debug = 1;
} else {
$debug = 0;
}

Now, before you save the config.php file you must replace the 123.123.123.123 with your own IP address. You can find your own IP by surfing to this web site: http://www.whatismyip.com/

Changed it? Good, now save the config.php file.

Optional tip: If you want even more options, you can set your userid to the variables $canrunqueries and $canpruneadminlog and $canviewadminlog

HiDeo
14th November 2004, 09:01 PM
Really nice modification, but my ip change all 24 hours :(

reteep
14th November 2004, 09:04 PM
Yep, I'm also on DSL Dial-up. But probably very nice for static IP users :)

Oblivion Knight
14th November 2004, 11:48 PM
If you list your own userid in the $undeletableusers array, are you able to still edit the account if you are the owner of it? I haven't played around with it, and have always wondered this.. ;)

Tony
15th November 2004, 02:03 AM
A very useful tip, thank you for sharing floris. :)

OneBigJoke
18th November 2004, 01:30 AM
If you list your own userid in the $undeletableusers array, are you able to still edit the account if you are the owner of it? I haven't played around with it, and have always wondered this.. ;)
undeletable == undeletable
You can't. Even as super admin in debug mode.