n°524 - password policy

bugfix: no rule does work properly
This commit is contained in:
bruno DA SILVA
2019-11-22 12:31:14 +01:00
parent 23fc4bb4f7
commit b9cb692504
2 changed files with 8 additions and 1 deletions

View File

@@ -157,7 +157,7 @@ class UserLocal extends UserInternal
public function IsPasswordValid()
{
return (isset($this->m_oPasswordValidity)) && ($this->m_oPasswordValidity->isPasswordValid());
return (empty($this->m_oPasswordValidity)) || ($this->m_oPasswordValidity->isPasswordValid());
}
/**

View File

@@ -73,6 +73,13 @@ class UserLocalTest extends ItopTestCase
'password' => 'foo',
'expectedCheckStatus' => false,
),
'noPattern' => array(
'valueMap' => array(
array('authent-local', 'password_validation.pattern', null, '')
),
'password' => 'foo',
'expectedCheckStatus' => true,
),
'validClass' => array(
'valueMap' => array(
array(