A client of our wants a logon page on their website to only appear if a user is using a computer out of the company's network.
Any ideas how this can be done, and if anyone has done it.
[edited by: eelixduppy at 10:31 pm (utc) on May 18, 2010] [edit reason] no solicitations, please [/edit]
10:39 pm on May 18, 2010 (gmt 0)
By "out of the company's network" do you mean outside the company's IP address range? Or do you mean something else? If the former, then just do a check on the user's IP address. If the later, then hwo is "out of the company's network" defined?
11:38 pm on May 18, 2010 (gmt 0)
Yes outside of the companies network. They don't want internal users to see the login page or even the link to it.
12:02 am on May 19, 2010 (gmt 0)
You can use $_SERVER["REMOTE_ADDR"] and check against the range of IP addresses the company uses.
And even nicer implementation (just in case the user is using a proxy) would be: if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $TheIp=$_SERVER['HTTP_X_FORWARDED_FOR']; else $TheIp=$_SERVER['REMOTE_ADDR'];
7:41 am on May 19, 2010 (gmt 0)
Thanks. How is that converted into hiding a logon div panel if the user is within the companies ip range? Geoffb
3:18 pm on May 19, 2010 (gmt 0)
You check the user's IP against the company's range. If it's in the range, you don't show the logon panel.
3:26 pm on May 19, 2010 (gmt 0)
if you cant do IPs, then you can give all the browsers in the building their own user_agent, and check that instead... assuming that the company has control over the browsers.
its a five-second job with firefox. never tried with IE.