N°2888 Check password policy only if field set with a string

Some callers are setting the field using an ormPassword object containing hashed password + salt

examples:
 - csv import
 - data synchro
 - ...
This commit is contained in:
bruno DA SILVA
2020-03-25 12:43:41 +01:00
parent 75a900c6f8
commit 46151c87c0

View File

@@ -249,6 +249,14 @@ class UserLocal extends UserInternal
$config = MetaModel::GetConfig();
}
//if the $proposedValue is an ormPassword, then it cannot be checked
//this if is even more permissive as we can only check against strings
if (!is_string($proposedValue) && !empty($proposedValue))
{
$this->m_oPasswordValidity = new UserLocalPasswordValidity(true);
return;
}
if (null == $aValidatorCollection)
{
$aValidatorCollection = MetaModel::EnumPlugins('iModuleExtension', 'UserLocalPasswordValidator');