Welcome to WebmasterWorld Guest from 54.162.218.217

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Showing login page based on location

     
10:27 pm on May 18, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:Apr 20, 2008
posts: 133
votes: 0


Hi all,

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.

cheers
geoffb

[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)

Moderator from US 

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 10, 2005
posts:5668
votes: 76


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)

Junior Member

5+ Year Member

joined:Apr 20, 2008
posts:133
votes: 0


Hi lifeinasia,

Yes outside of the companies network. They don't want internal users to see the login page or even the link to it.

Geoffb
12:02 am on May 19, 2010 (gmt 0)

Moderator from US 

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 10, 2005
posts:5668
votes: 76


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)

Junior Member

5+ Year Member

joined:Apr 20, 2008
posts:133
votes: 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)

Moderator from US 

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 10, 2005
posts:5668
votes: 76


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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Feb 12, 2006
posts:2596
votes: 68


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.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members