From b860d7fb50eecb9b2ea2894b800120dad8a20cd2 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 23 Sep 2011 09:29:59 +0000 Subject: [PATCH] set the session cache for auth_alpwchange_val on setLastPwdChange --- phpgwapi/inc/class.auth_ldap.inc.php | 1 + phpgwapi/inc/class.auth_sql.inc.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.auth_ldap.inc.php b/phpgwapi/inc/class.auth_ldap.inc.php index d351e97abb..e9117e9511 100644 --- a/phpgwapi/inc/class.auth_ldap.inc.php +++ b/phpgwapi/inc/class.auth_ldap.inc.php @@ -245,6 +245,7 @@ class auth_ldap implements auth_backend { return false; } + egw_cache::setSession('phpgwapi','auth_alpwchange_val',$entry['shadowlastchange']); return true; } diff --git a/phpgwapi/inc/class.auth_sql.inc.php b/phpgwapi/inc/class.auth_sql.inc.php index 35cae43498..20ffa045b0 100644 --- a/phpgwapi/inc/class.auth_sql.inc.php +++ b/phpgwapi/inc/class.auth_sql.inc.php @@ -176,14 +176,15 @@ class auth_sql implements auth_backend { return false; } + $lastpwdchange = (is_null($lastpwdchange) || $lastpwdchange<0 ? time():$lastpwdchange); $this->db->update($this->table,array( - 'account_lastpwd_change' => (is_null($lastpwdchange) || $lastpwdchange<0 ? time():$lastpwdchange), + 'account_lastpwd_change' => $lastpwdchange, ),array( 'account_id' => $account_id, ),__LINE__,__FILE__); if(!$this->db->affected_rows()) return false; - + egw_cache::setSession('phpgwapi','auth_alpwchange_val',$lastpwdchange); return true; }