From 2e33eeaab677f3e40fef25c2feb8bb5d07465f62 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 24 Sep 2010 08:20:14 +0000 Subject: [PATCH] fixing ACL check for nopasswordchange; fixing setting of shadowlastchange by using the correct data with propper format --- phpgwapi/inc/class.accounts_ldap.inc.php | 4 ++-- phpgwapi/inc/class.auth.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.accounts_ldap.inc.php b/phpgwapi/inc/class.accounts_ldap.inc.php index ff0456a4d0..03a25c5b2c 100644 --- a/phpgwapi/inc/class.accounts_ldap.inc.php +++ b/phpgwapi/inc/class.accounts_ldap.inc.php @@ -590,8 +590,8 @@ class accounts_ldap { unset($to_write['shadowexpire']); // gives protocoll error otherwise } - - if ($data['account_lastpwd_change']) $to_write['shadowlastchange'] = $data['lastpwd_change']/(24*3600); + //error_log(__METHOD__.__LINE__.$data['account_lid'].'#'.$data['account_lastpwd_change'].'#'); + if ($data['account_lastpwd_change']) $to_write['shadowlastchange'] = round(($data['account_lastpwd_change']-$utc_diff)/(24*3600)); if (isset($data['account_lastpwd_change']) && $data['account_lastpwd_change']==0) $to_write['shadowLastChange'] = 0; // lastlogin and lastlogin from are not availible via the shadowAccount object class // $to_write['phpgwaccountlastlogin'] = $data['lastlogin']; diff --git a/phpgwapi/inc/class.auth.inc.php b/phpgwapi/inc/class.auth.inc.php index 49b157878c..4624e2640d 100644 --- a/phpgwapi/inc/class.auth.inc.php +++ b/phpgwapi/inc/class.auth.inc.php @@ -89,7 +89,7 @@ class auth ) || $GLOBALS['egw_info']['user'][$alpwchange]==0) ) { - if ($GLOBALS['egw']->acl->check('nopasswordchange', 1)) return true; // user has no rights to change password + if ($GLOBALS['egw']->acl->check('nopasswordchange', 1, 'preferences')) return true; // user has no rights to change password error_log(__METHOD__.' Password of '.$GLOBALS['egw_info']['user']['account_lid'].' ('.$GLOBALS['egw_info']['user']['account_fullname'].') is of old age.'.array2string(array( 'ts'=>$GLOBALS['egw_info']['user']['account_lastpwd_change'], 'date'=>egw_time::to($GLOBALS['egw_info']['user']['account_lastpwd_change']))));