fixing ACL check for nopasswordchange; fixing setting of shadowlastchange by using the correct data with propper format

This commit is contained in:
Klaus Leithoff 2010-09-24 08:20:14 +00:00
parent 2b4eddc56b
commit 2e33eeaab6
2 changed files with 3 additions and 3 deletions

View File

@ -590,8 +590,8 @@ class accounts_ldap
{ {
unset($to_write['shadowexpire']); // gives protocoll error otherwise unset($to_write['shadowexpire']); // gives protocoll error otherwise
} }
//error_log(__METHOD__.__LINE__.$data['account_lid'].'#'.$data['account_lastpwd_change'].'#');
if ($data['account_lastpwd_change']) $to_write['shadowlastchange'] = $data['lastpwd_change']/(24*3600); 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; 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 // lastlogin and lastlogin from are not availible via the shadowAccount object class
// $to_write['phpgwaccountlastlogin'] = $data['lastlogin']; // $to_write['phpgwaccountlastlogin'] = $data['lastlogin'];

View File

@ -89,7 +89,7 @@ class auth
) || $GLOBALS['egw_info']['user'][$alpwchange]==0) ) || $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( 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'], 'ts'=>$GLOBALS['egw_info']['user']['account_lastpwd_change'],
'date'=>egw_time::to($GLOBALS['egw_info']['user']['account_lastpwd_change'])))); 'date'=>egw_time::to($GLOBALS['egw_info']['user']['account_lastpwd_change']))));