Part of Password-Feature

This commit is contained in:
Klaus Leithoff 2010-09-22 10:11:11 +00:00
parent e3c4964816
commit 5c982aeb8a

View File

@ -38,7 +38,7 @@ else
$app = 'home'; $app = 'home';
$invalid_data = True; $invalid_data = True;
} }
//error_log(__METHOD__."$app,$class,$method");
if($app == 'phpgwapi') if($app == 'phpgwapi')
{ {
$app = 'home'; $app = 'home';
@ -53,7 +53,30 @@ $GLOBALS['egw_info'] = array(
) )
); );
include('./header.inc.php'); include('./header.inc.php');
// check if users are supposed to change their password every x sdays, then check if password is of old age or the devil-admin reset the users password
// and forced the user to change his password on next login.
auth::check_password_age($app,$class,$method);
/*if ((($GLOBALS['egw_info']['server']['change_pwd_every_x_days'] &&
egw_time::to('now','ts')-($GLOBALS['egw_info']['server']['change_pwd_every_x_days']*86400)>$GLOBALS['egw_info']['user']['account_lastpwd_change']
) || $GLOBALS['egw_info']['user']['account_lastpwd_change']==666) &&
($GLOBALS['egw_info']['user']['apps']['preferences'] || $GLOBALS['egw_info']['user']['apps']['password'])&&
!($app == 'preferences' && $class == 'uipassword' && $method=='change'))
{
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']))));
if ($GLOBALS['egw_info']['user']['account_lastpwd_change']==666)
{
$message = lang('an admin required that you must change your password upon login.');
}
else
{
$message = lang('it has been more then %1 days since you changed your password',$GLOBALS['egw_info']['server']['change_pwd_every_x_days']);
}
if ($GLOBALS['egw_info']['user']['apps']['password']) egw::redirect_link('/preferences/password.php',array('message'=>$message));
egw::redirect_link('/index.php',array('menuaction'=>'preferences.uipassword.change','message'=>$message));
}
*/
// user changed timezone // user changed timezone
if (isset($_GET['tz'])) if (isset($_GET['tz']))
{ {