mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 12:51:52 +02:00
SF #413717 - Fixed undefined function update_lastlogin(), this problem was for more then just mail_auth
This commit is contained in:
parent
a6081e5184
commit
50c4666ecc
@ -41,5 +41,17 @@
|
|||||||
global $phpgw_info, $phpgw;
|
global $phpgw_info, $phpgw;
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Since there account data will still be stored in SQL, this should be safe to do. (jengo)
|
||||||
|
function update_lastlogin($account_id, $ip)
|
||||||
|
{
|
||||||
|
global $phpgw;
|
||||||
|
|
||||||
|
$account_id = get_account_id($account_id);
|
||||||
|
|
||||||
|
$phpgw->db->query("update phpgw_accounts set account_lastloginfrom='"
|
||||||
|
. "$ip', account_lastlogin='" . time()
|
||||||
|
. "' where account_id='$account_id'",__LINE__,__FILE__);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -26,7 +26,8 @@
|
|||||||
|
|
||||||
class auth
|
class auth
|
||||||
{
|
{
|
||||||
function authenticate($username, $passwd) {
|
function authenticate($username, $passwd)
|
||||||
|
{
|
||||||
global $phpgw_info, $phpgw;
|
global $phpgw_info, $phpgw;
|
||||||
// error_reporting MUST be set to zero, otherwise you'll get nasty LDAP errors with a bad login/pass...
|
// error_reporting MUST be set to zero, otherwise you'll get nasty LDAP errors with a bad login/pass...
|
||||||
// these are just "warnings" and can be ignored.....
|
// these are just "warnings" and can be ignored.....
|
||||||
@ -37,7 +38,7 @@
|
|||||||
// find the dn for this uid, the uid is not always in the dn
|
// find the dn for this uid, the uid is not always in the dn
|
||||||
$sri = ldap_search($ldap, $phpgw_info['server']['ldap_context'], 'uid='.$username);
|
$sri = ldap_search($ldap, $phpgw_info['server']['ldap_context'], 'uid='.$username);
|
||||||
$allValues = ldap_get_entries($ldap, $sri);
|
$allValues = ldap_get_entries($ldap, $sri);
|
||||||
if($allValues['count'] > 0)
|
if ($allValues['count'] > 0)
|
||||||
{
|
{
|
||||||
// we only care about the first dn
|
// we only care about the first dn
|
||||||
$userDN = $allValues[0]['dn'];
|
$userDN = $allValues[0]['dn'];
|
||||||
@ -81,6 +82,7 @@
|
|||||||
return $encrypted_passwd;
|
return $encrypted_passwd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This data needs to be updated in LDAP, not SQL (jengo)
|
||||||
function update_lastlogin($account_id, $ip)
|
function update_lastlogin($account_id, $ip)
|
||||||
{
|
{
|
||||||
global $phpgw;
|
global $phpgw;
|
||||||
@ -92,5 +94,5 @@
|
|||||||
. "$ip', account_lastlogin='" . $now
|
. "$ip', account_lastlogin='" . $now
|
||||||
. "' where account_id='$account_id'",__LINE__,__FILE__);
|
. "' where account_id='$account_id'",__LINE__,__FILE__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -67,5 +67,18 @@
|
|||||||
global $phpgw_info, $phpgw;
|
global $phpgw_info, $phpgw;
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Since there account data will still be stored in SQL, this should be safe to do. (jengo)
|
||||||
|
function update_lastlogin($account_id, $ip)
|
||||||
|
{
|
||||||
|
global $phpgw;
|
||||||
|
|
||||||
|
$account_id = get_account_id($account_id);
|
||||||
|
|
||||||
|
$phpgw->db->query("update phpgw_accounts set account_lastloginfrom='"
|
||||||
|
. "$ip', account_lastlogin='" . time()
|
||||||
|
. "' where account_id='$account_id'",__LINE__,__FILE__);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user