| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Limit ADMIN Login to a Geographical Area! | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Limit ADMIN Login to a Geographical Area!
Hi everyone,
(Verified to work on Version 4.4.5) This will allow you to lock your admin area down so that it can only be accessed from IP Addresses located in a specfied geographic area. It's great if you have a dynamic IP address, or need to allow access from an entire city (i.e. you're on the move and using wireless technology). This modication will
This modication will automatically BAN the IP address from accessing the /admin directory the second they try and log in. If you manage to ban yourself (you won't be able to get to the logon page anymore, it will behave as if the page is missing), edit /admin/.htaccess and delete the "DENY FROM <your ip address>" Here is the modification. Feel free to post any improvements... 1> Edit admin/login.php 2> below line 48 which says require './auth.php' Paste the following: Code:
Notes: 1> Edit $maximum_distance = 100 to a value you find appropriate. Please note the Geographic IP lookup isn't exact. Right now it says I'm 27 miles from my actual location. Perhaps start with a small number and increase until it doesn't deny you access. 2> Change the city name, state, country and Zip/Post code to your location. Note that the country codes in use are 2 letter diagraphs. If you aren't sure, try looking your country up here 3> This modification is particularly good if you don't want to whitelist (i.e. specify an exact IP address). 4> Make sure you edit the email address (two entries) to ensure it emails you). If you like it, give it a vote / rating
__________________
X-Cart Gold 4.6.1 |
|||||||||
|
#2
|
|||||||||
|
|||||||||
Re: Limit ADMIN Login to a Geographical Area!
Hi everyone,
Code updated to 1> Ensure it doesn't do a check on logout. 2> Let you know how many GeoIP requests you have remaining. 3> Works in 4.6.1 4> Includes an IP whitelist Same instructions... here is the code. You'll want to change the bits in red. Code:
__________________
X-Cart Gold 4.6.1 |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|