for new (autocreated) accounts, set ->can change password<- appropriately, move section before processing of hooks

This commit is contained in:
Klaus Leithoff 2012-06-29 13:54:13 +00:00
parent fa90c1066c
commit 45fe6d9fea

View File

@ -862,13 +862,6 @@ class accounts
{
return false;
}
// call hook to notify interested apps about the new account
$GLOBALS['hook_values'] = $data;
$GLOBALS['egw']->hooks->process($data+array(
'location' => 'addaccount',
// at login-time only the hooks from the following apps will be called
'order' => array('felamimail','fudforum'),
),False,True); // called for every app now, not only enabled ones
// set the appropriate value for the can change password flag (assume users can, if the admin requires users to change their password)
$data['changepassword'] = (bool)$GLOBALS['egw_info']['server']['change_pwd_every_x_days'];
if(!$data['changepassword'])
@ -879,6 +872,13 @@ class accounts
{
$GLOBALS['egw']->acl->delete_repository('preferences','nopasswordchange',$data['account_id']);
}
// call hook to notify interested apps about the new account
$GLOBALS['hook_values'] = $data;
$GLOBALS['egw']->hooks->process($data+array(
'location' => 'addaccount',
// at login-time only the hooks from the following apps will be called
'order' => array('felamimail','fudforum'),
),False,True); // called for every app now, not only enabled ones
unset($data['changepassword']);
// set memberships if given
if ($memberships)