diff --git a/login.php b/login.php index 4d19ec32a5..6c8d7fef33 100755 --- a/login.php +++ b/login.php @@ -343,12 +343,14 @@ else // redirect to referer on logout $GLOBALS['egw']->session->appsession('referer', 'login', $_SERVER['HTTP_REFERER']); } - + $strength = ($GLOBALS['egw_info']['server']['force_pwd_strength']?$GLOBALS['egw_info']['server']['force_pwd_strength']:false); + if ($strength && $strength>5) $strength =5; + if ($strength && $strength<0) $strength = false; // Check for save passwd - if($GLOBALS['egw_info']['server']['check_save_passwd'] && $GLOBALS['egw']->acl->check('changepassword', 1, 'preferences') && - ($unsave_msg = $GLOBALS['egw']->auth->crackcheck($passwd))) + if($strength && $GLOBALS['egw_info']['server']['check_save_passwd'] && !$GLOBALS['egw']->acl->check('nopasswordchange', 1, 'preferences') && + ($unsave_msg = $GLOBALS['egw']->auth->crackcheck($passwd, $strength))) { - $GLOBALS['egw']->log->write(array('text'=>'D-message, User '. $login. ' authenticated with an unsave password','file' => __FILE__,'line'=>__LINE__)); + error_log('login::'.__LINE__.' User '. $login. ' authenticated with an unsave password'.' '.$unsave_msg); $message = lang('eGroupWare checked your password for safetyness. You have to change your password for the following reason:')."\n"; egw::redirect_link('/index.php', array( 'menuaction' => 'preferences.uipassword.change', diff --git a/preferences/inc/class.uipassword.inc.php b/preferences/inc/class.uipassword.inc.php index 456ae7d6e8..f746a206ea 100644 --- a/preferences/inc/class.uipassword.inc.php +++ b/preferences/inc/class.uipassword.inc.php @@ -27,7 +27,7 @@ class uipassword $n_passwd = $_POST['n_passwd']; $n_passwd_2 = $_POST['n_passwd_2']; $o_passwd_2 = $_POST['o_passwd_2']; - + if (isset($_GET['message'])) $_GET['message'] = str_replace("
"," ",html::purify($_GET['message'])); if($GLOBALS['egw']->acl->check('nopasswordchange', 1) || $_POST['cancel']) { if ($GLOBALS['egw_info']['user']['apps']['preferences'])