* @package tao */ class tao_actions_form_ResetUserPassword extends tao_helpers_form_FormContainer { /** * Initialize password reset form * * @access public * @author Aleh Hutnikau * @return mixed */ public function initForm() { $this->form = tao_helpers_form_FormFactory::getForm('resetUserPassword'); $connectElt = tao_helpers_form_FormFactory::getElement('reset', 'Submit'); $connectElt->setValue(__('Update')); $connectElt->setAttribute('class', 'btn-success small'); $this->form->setActions([$connectElt], 'bottom'); } /** * Initialiaze password reset form elements * * @access public * @author Aleh Hutnikau * @return mixed */ public function initElements() { $tokenElement = tao_helpers_form_FormFactory::getElement('token', 'Hidden'); $this->form->addElement($tokenElement); $pass1Element = tao_helpers_form_FormFactory::getElement('newpassword', 'Hiddenbox'); $pass1Element->setDescription(__('New password')); $pass1Element->addValidators(PasswordConstraintsService::singleton()->getValidators()); $pass1Element->setBreakOnFirstError(false); $this->form->addElement($pass1Element); $pass2Element = tao_helpers_form_FormFactory::getElement('newpassword2', 'Hiddenbox'); $pass2Element->setDescription(__('Repeat new password')); $pass2Element->addValidators([ tao_helpers_form_FormFactory::getValidator('Password', ['password2_ref' => $pass1Element]), ]); $this->form->addElement($pass2Element); } }