AdminCP Access

If someone tries to access your AdminCP and they are not the IP, User Group, or User ID that you defined, they will automatically be forwarded to the forum home. If you wanted to you could enable the IP, User Group, and User ID at once. Enable as many of the features as you feel a need for.


Features:

* Enable and Disable hack (Disabled by default)
* Define MULTIPLE IPs that are allowed to access the AdminCP
* Able to separate multiple IPs by | (No spaces between the IPs and |)
* Define MULTIPLE User Groups that are allowed to access the AdminCP
* Able to separate multiple User Groups by | (No spaces between the User Groups and |)
* Define MULTIPLE User IDs that are allowed to access the AdminCP
* Able to separate multiple User IDs by | (No spaces between the User IDs and |)

Upgrade:
You MUST uninstall the old product after that just follow the directions of the New Installation.

File Edits:
In admincp/index.php find:

Code:
require_once('./global.php');


Add after:
Code:
if ($vbulletin->options['allowip_enabled']){
$valid_ips = explode("|", $vbulletin->options['allowedips']);
if (!in_array($_SERVER['REMOTE_ADDR'],$valid_ips)) {
    header('Location: ../index.php'); //change according to your site setup
    exit();
}
}
//allowed usergroups
if ($vbulletin->options['allowgroups_enabled']){
$valid_ids = explode("|", $vbulletin->options['allowedgroups']);
if (!in_array($vbulletin->userinfo['usergroupid'], $valid_ids)) {
    header('Location: ../index.php'); //change according to your site setup
    exit();
}
}
//allowed user ids
if ($vbulletin->options['allowids_enabled']){
$valid_ids = explode("|", $vbulletin->options['allowedids']);
if (!in_array($vbulletin->userinfo['userid'], $valid_ids)) {
    header('Location: ../index.php'); //change according to your site setup
    exit();
}
}

New Installation:
1.) Perform the file edits

2.) Go to AdminCP-> Plugins & Products-> Manage Products-> Import the product-admincpaccess.

3.) Go to AdminCP-> VBulletin Options-> VBulletin Options-> AdminCP Access.

4.) Under AdminCP Allowed IPs put your IP and then enable the hack and save. For multiple IPs just follow this example:
1.1.1.1|2.2.2.2|3.3.3.3|

Optional:
1.) Under AdminCP Allowed User Groups put the User Groups you wish to allow access and then enable the hack and save. For multiple User Groups just follow this example:
6|7

2.) Under AdminCP Allowed User IDs put the User IDs you wish to allow access and then enable the hack and save. For multiple User IDs just follow this example:
1|2|3

*If you locked yourself out just reupload your original admincp/index.php file to you admincp root. Go into your AdminCP-> VBulletin Options-> VBulletin Options-> AdminCP Access and fix what ever caused you to get locked out. Once you fix it just reupload the edited admincp/index.php file.
 
Top