It has been a while since I last posted on this topic, but I am in the middle of putting together the ip authentication module for allowing access to my DB by providing a range of IP's. I am also green at php, but am getting a little more fluent with each day (not shown by post below, but true).
I have created a module directory called Auth and a directory called ip inside it
I also created a file called ip.php (I did not use isLoggedIn function, which might be my problem. Instead tried to change http cauth)
- Code: Select all
class dataface_modules_ip {
function authenticate(){
$auth =& Dataface_AuthenticationTool::getInstance();
if ( $auth->checkCredentials()){
$creds = $this->getCredentials();
$_SERVER['REMOTE_ADDR'] = $creds['REMOTE_ADDR'];
return true;
} else {
return PEAR::raiseError('No credentials were included.', DATAFACE_E_REQUEST_NOT_HANDLED);
}
}
function getCredentials(){
$ip_address = ( isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null);
return array('REMOTE_ADDR'=>$ip_address);
}
}
My Conf.ini file reads
[_auth]
auth_type=ip
users_table="Users"
ip_address_column="ip_address"
Should I have an ip_table in place instead of Users?
I am not sure how to tell xataface where to find the ip addresses so that we can add different ip ranges specific to each user and the system will check them before allowing access.
I tried this and got nothing - I am finding the boards and documentation to be very helpful but could use some hints/help as to where to store the ip addresses that will be allowed access to the db.
Much appreciated