fixed not being able to switch "forbid password to contain name" off again, after it has been switched on (caused by name "passwd_forbid_name")

This commit is contained in:
Ralf Becker 2013-07-16 14:50:12 +00:00
parent b04ee25e07
commit 10436d5e41
3 changed files with 5 additions and 5 deletions

View File

@ -272,8 +272,8 @@
<td>{lang_Reject_passwords_containing_part_of_username_or_full_name_(3_or_more_characters_long)}:</td>
<td>
<select name="newsettings[passwd_forbid_name]">
<option value="">{lang_No}</option>
<option value="True"{selected_True}>{lang_Yes}</option>
<option value="no">{lang_No}</option>
<option value="yes"{selected_passwd_forbid_name_yes}>{lang_Yes}</option>
</select>
</td>
</tr>

View File

@ -532,7 +532,7 @@ class auth
* @param string $password
* @param int $reqstrength=null defaults to whatever set in config for "force_pwd_strength"
* @param int $minlength=null defaults to whatever set in config for "check_save_passwd"
* @param boolean $forbid_name=null if true username or full-name split by delimiters AND longer then 3 chars are
* @param string $forbid_name=null if "yes" username or full-name split by delimiters AND longer then 3 chars are
* forbidden to be included in password, default to whatever set in config for "passwd_forbid_name"
* @param array|int $account=null array with account_lid and account_fullname or account_id for $forbid_name check
* @return mixed false if password is considered "safe" (or no requirements) or a string $message if "unsafe"
@ -567,7 +567,7 @@ class auth
$errors[] = lang('password must have at least %1 characters', $minlength);
}
if ($forbid_name)
if ($forbid_name === 'yes')
{
if (!$account || !is_array($account) && !($account = $GLOBALS['egw']->accounts->read($account)))
{

View File

@ -223,7 +223,7 @@ class auth_ads implements auth_backend
// if admin has nothing configured use windows default of 3 char classes, 7 chars min and name-part-check
$GLOBALS['egw_info']['server']['force_pwd_strength'] ? $GLOBALS['egw_info']['server']['force_pwd_strength'] : 3,
$GLOBALS['egw_info']['server']['force_pwd_length'] ? $GLOBALS['egw_info']['server']['force_pwd_length'] : 7,
$GLOBALS['egw_info']['server']['passwd_forbid_name'] ? $GLOBALS['egw_info']['server']['passwd_forbid_name'] : true,
$GLOBALS['egw_info']['server']['passwd_forbid_name'] ? $GLOBALS['egw_info']['server']['passwd_forbid_name'] : 'yes',
$account_id);
$msg = $e->getMessage();
$msg = strtr($msg, $tr=array( // translate possible adLDAP and LDAP error