fix for not working pam-auth if magic_quotes_gpc is on, as suggested by Robert Theisen <trobert@redhat.com> on the developer list

This commit is contained in:
Ralf Becker 2005-04-15 14:46:29 +00:00
parent 327c0765ea
commit d6ba225257

View File

@ -24,7 +24,7 @@
{ {
function authenticate($username, $passwd) function authenticate($username, $passwd)
{ {
if(pam_auth($username, $passwd, &$error)) if (pam_auth($username, get_magic_quotes_gpc() ? stripslashes($passwd) : $passwd, $error))
{ {
return True; return True;
} }
@ -43,9 +43,10 @@
function update_lastlogin($account_id, $ip) function update_lastlogin($account_id, $ip)
{ {
$account_id = get_account_id($account_id); $account_id = get_account_id($account_id);
$GLOBALS['phpgw']->db->query("UPDATE phpgw_accounts SET account_lastloginfrom='"
. "$ip', account_lastlogin='" . time() $GLOBALS['phpgw']->db->query('update phpgw_accounts set account_lastloginfrom='
. "' WHERE account_id='$account_id'",__LINE__,__FILE__); . $GLOBALS['phpgw']->db->quote($ip).', account_lastlogin=' . time()
. ' where account_id='.(int)$account_id,__LINE__,__FILE__);
} }
} }
?> ?>