Page 1 of 1

authenticate only users outside internal ip

Posted: Fri Apr 04, 2008 4:00 pm
by batty13
Just need to know if its even possible...

Does anyone know of a way to request login for users outside an internal ip address? I have a client that wants users in the network to be able to access data without a login. (detect ip). However, when they are at home still have access but require them to login.

I know that the best way is to just have them login with email address and pw that they create. However, this client does not want to do things in the standard norm. They insist that the data has to be handled in this way.

I cant think of a way myself as the folder would be set to authenticate, that there is no way around having to login to a secure folder regardless of your ip.

at my wits end.

Re: authenticate only users outside internal ip

Posted: Fri Apr 18, 2008 12:04 pm
by samb0057
if (substr($_SERVER['REMOTE_ADDR'], 0, 4) === '127.' or substr($_SERVER['REMOTE_ADDR'], 0, 8) === '192.168.' or substr($_SERVER['REMOTE_ADDR'], 0, 3) === '10.') {
// user is on internal network
}
else {
// require login
}