Line 48 | Line 48 |
---|
if (!$password) { return array(
|
if (!$password) { return array(
|
'status' => LOGIN_BREAK,
| 'status' => LOGIN_ERROR_PASSWORD,
|
'error_msg' => 'NO_PASSWORD_SUPPLIED',
|
'error_msg' => 'NO_PASSWORD_SUPPLIED',
|
| 'user_row' => array('user_id' => ANONYMOUS), ); }
if (!$username) { return array( 'status' => LOGIN_ERROR_USERNAME, 'error_msg' => 'LOGIN_ERROR_USERNAME', 'user_row' => array('user_id' => ANONYMOUS),
|
); }
| ); }
|
Line 138 | Line 148 |
---|
if (!empty($php_auth_user) && !empty($php_auth_pw)) {
|
if (!empty($php_auth_user) && !empty($php_auth_pw)) {
|
set_var($php_auth_user, $php_auth_user, 'string'); set_var($php_auth_pw, $php_auth_pw, 'string');
| set_var($php_auth_user, $php_auth_user, 'string', true); set_var($php_auth_pw, $php_auth_pw, 'string', true);
|
$sql = 'SELECT * FROM ' . USERS_TABLE . "
| $sql = 'SELECT * FROM ' . USERS_TABLE . "
|
Line 207 | Line 217 |
---|
'group_id' => (int) $row['group_id'], 'user_type' => USER_NORMAL, 'user_ip' => $user->ip,
|
'group_id' => (int) $row['group_id'], 'user_type' => USER_NORMAL, 'user_ip' => $user->ip,
|
| 'user_new' => ($config['new_member_post_limit']) ? 1 : 0,
|
); }
| ); }
|
Line 217 | Line 228 |
---|
*/ function validate_session_apache(&$user) {
|
*/ function validate_session_apache(&$user) {
|
if (!isset($_SERVER['PHP_AUTH_USER']))
| // Check if PHP_AUTH_USER is set and handle this case if (isset($_SERVER['PHP_AUTH_USER']))
|
{
|
{
|
return false; }
| |
$php_auth_user = '';
|
$php_auth_user = '';
|
set_var($php_auth_user, $_SERVER['PHP_AUTH_USER'], 'string');
| set_var($php_auth_user, $_SERVER['PHP_AUTH_USER'], 'string', true);
|
return ($php_auth_user === $user['username']) ? true : false;
|
return ($php_auth_user === $user['username']) ? true : false;
|
| }
// PHP_AUTH_USER is not set. A valid session is now determined by the user type (anonymous/bot or not) if ($user['user_type'] == USER_IGNORE) { return true; }
return false;
|
}
?>
| }
?>
|