The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Allow Certain IP's To Access (or View) AdminCP
Can someone tell me how to stop anyone from viewing the admincp if they don't have an IP in the list? I know I can use a htaccess to stop anyone from accessing it, but is there a way that I can enter an IP address (If the admin user uses a static IP) that is only allowed to see the admincp?
|
#2
|
|||
|
|||
At the beginning of your index.php file in your admincp folder, add the following:
Code:
if(!preg_match("/^(68\.142\.18\.|68\.143\.19\.)/",$_SERVER['REMOTE_ADDR'])){ header("HTTP/1.0 403 Forbidden",1); echo "<h2>403 Forbidden</h2>"; exit(); } Code:
if(!preg_match("/^68\.142\.1\.143/",$_SERVER['REMOTE_ADDR'])){ header("HTTP/1.0 403 Forbidden",1); echo "<h2>403 Forbidden</h2>"; exit(); } Here is an example of the WRONG way: Code:
if(!preg_match("/^68\.142\.1/",$_SERVER['REMOTE_ADDR'])){ header("HTTP/1.0 403 Forbidden",1); echo "<h2>403 Forbidden</h2>"; exit(); } |
#3
|
||||
|
||||
Do you use Apache?
Then i'd suggest using .htaccess <Limit GET POST> order deny,allow deny from all allow from 199.166.210.12 </Limit> This wil only allow access form IP 199.166.210.12. If you want to allow several IPs, repeat the allow-line. Isn't that what you want? |
#4
|
|||
|
|||
What I posted was a software mod in PHP... the apache version is more desirable and works just as well.
If your ISP doesn't allow .htaccess, do the PHP version. |
#5
|
||||
|
||||
Quote:
All other scripts would still be accessable? |
#6
|
||||
|
||||
Quote:
I did use htaccess to protect my admin cp, but one day I forgot my password and I had to go into my cpanel to re-create the htaccess. Also, at times where I need quick access, and don't want to enter a password, this fix does it. :ermm: |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|