* @license GPLv2 * @package tao * */ use oat\generis\model\user\PasswordConstraintsService; class tao_helpers_form_validators_PasswordStrength extends tao_helpers_form_Validator { /** * Short description of method evaluate * * @access public * @param values * @return boolean */ public function evaluate($values) { $returnValue = PasswordConstraintsService::singleton()->validate($values); if (!$returnValue && !$this->hasOption('message')) { $this->setMessage(implode(', ', PasswordConstraintsService::singleton()->getErrors())); } return (bool) $returnValue; } }