| version 1.3, 2005/11/07 22:24:40 |
version 1.4, 2007/02/24 23:00:24 |
|
|
| * http://platon.sk/projects/phpPlatonLib/ |
* http://platon.sk/projects/phpPlatonLib/ |
| */ |
*/ |
| |
|
| /* $Platon: phpPlatonLib/Auth_AuthDB/AuthDB.php,v 1.11 2003/07/27 15:42:30 nepto Exp $ */ |
/* $Platon: phpPlatonLib/Auth_AuthDB/AuthDB.php,v 1.12 2007-02-24 22:57:41 nepto Exp $ */ |
| |
|
| /* |
/* |
| * History: |
* History: |
|
|
| |
|
| function assignData() |
function assignData() |
| { |
{ |
| global $HTTP_POST_VARS; |
|
| |
|
| /* Empty passwords are allowed. Empty usernames not. */ |
/* Empty passwords are allowed. Empty usernames not. */ |
| |
|
| if (isset($HTTP_POST_VARS['username']) |
if (isset($_POST['username']) |
| && $HTTP_POST_VARS['username'] != '') { |
&& $_POST['username'] != '') { |
| $this->_props['username'] = $HTTP_POST_VARS['username']; |
$this->_props['username'] = $_POST['username']; |
| |
|
| if (isset($HTTP_POST_VARS['password'])) { |
if (isset($_POST['password'])) { |
| $this->_props['password'] = $HTTP_POST_VARS['password']; |
$this->_props['password'] = $_POST['password']; |
| } |
} |
| } |
} |
| } |
} |
|
|
| |
|
| switch ($property) { |
switch ($property) { |
| case 'user_agent': |
case 'user_agent': |
| global $HTTP_SERVER_VARS; |
$ret = @$_SERVER['HTTP_USER_AGENT']; |
| $ret = $HTTP_SERVER_VARS['HTTP_USER_AGENT']; |
|
| $ret = substr(stripslashes($ret), 0, 255); |
$ret = substr(stripslashes($ret), 0, 255); |
| break; |
break; |
| |
|
| case 'remote_ip': |
case 'remote_ip': |
| global $HTTP_SERVER_VARS; |
|
| /* Sending HTTP_X_FORWARDED_FOR? OK, send anything you want, |
/* Sending HTTP_X_FORWARDED_FOR? OK, send anything you want, |
| but it must persist for the whole session. */ |
but it must persist for the whole session. */ |
| $ret = array(); |
$ret = array(); |
| foreach (array('REMOTE_ADDR', 'HTTP_X_FORWARDED_FOR') as $key) { |
foreach (array('REMOTE_ADDR', 'HTTP_X_FORWARDED_FOR') as $key) { |
| if (isset($HTTP_SERVER_VARS[$key])) |
if (isset($_SERVER[$key])) { |
| $ret[] = $HTTP_SERVER_VARS[$key]; |
$ret[] = $_SERVER[$key]; |
| |
} |
| } |
} |
| $ret = join(' / ', $ret); |
$ret = join(' / ', $ret); |
| break; |
break; |
| |
|
| default: |
default: |
| case 'session_id': |
case 'session_id': |
| global $HTTP_COOKIE_VARS; |
if (isset($_COOKIE[AUTH_DB_COOKIE_NAME])) { |
| if (isset($HTTP_COOKIE_VARS[AUTH_DB_COOKIE_NAME])) { |
$ret = $_COOKIE[AUTH_DB_COOKIE_NAME]; |
| $ret = $HTTP_COOKIE_VARS[AUTH_DB_COOKIE_NAME]; |
|
| $ret = intval(stripslashes($ret)); |
$ret = intval(stripslashes($ret)); |
| } else { |
} else { |
| $ret = ''; |
$ret = ''; |