protected function validator($varInput)
{
$this->blnSubmitInput = false;
if (($varInput == '' || $varInput == '*****') && $this->varValue != '') {
return '*****';
}
if (Utf8::strlen($varInput) < \Config::get('minPasswordLength')) {
$this->addError(sprintf($GLOBALS['TL_LANG']['ERR']['passwordLength'], \Config::get('minPasswordLength')));
}
if ($varInput != $this->getPost($this->strName . '_confirm')) {
$this->addError($GLOBALS['TL_LANG']['ERR']['passwordMatch']);
}
if ($varInput == $GLOBALS['TL_USERNAME']) {
$this->addError($GLOBALS['TL_LANG']['ERR']['passwordName']);
}
$varInput = parent::validator($varInput);
if (!$this->hasErrors()) {
$this->blnSubmitInput = true;
\Message::addConfirmation($GLOBALS['TL_LANG']['MSC']['pw_changed']);
return \Encryption::hash($varInput);
}
return '';
}