public function resetPassword()
    {
        $this->defaultData();
        $token = $this->getRequestParameter('token');

        $formContainer = new tao_actions_form_ResetUserPassword();
        $form = $formContainer->getForm();

        $form->setValues(array('token'=>$token));

        $user = $this->getPasswordRecovery()->getUser(PasswordRecoveryService::PROPERTY_PASSWORD_RECOVERY_TOKEN, $token);
        if ($user === null) {
            $this->logInfo("Password recovery token not found. Token value: {$token}");
            $this->setData('header', __('User not found'));
            $this->setData('error', __('This password reset link is no longer valid. It may have already been used. If you still wish to reset your password please request a new link'));
            $this->setData('content-template', array('passwordRecovery/password-recovery-info.tpl', 'tao'));
        } else {
            if ($form->isSubmited() && $form->isValid()) {
                $this->getPasswordRecovery()->setPassword($user, $form->getValue('newpassword'));
                $this->logInfo("User {$user->getUri()} has changed the password.");
                $this->setData('info', __("Password successfully changed"));
                $this->setData('content-template', array('passwordRecovery/password-recovery-info.tpl', 'tao'));
            } else {
                $this->setData('form', $form->render());
                $this->setData('content-template', array('passwordRecovery/password-reset.tpl', 'tao'));
            }
        }

        $this->setView('layout.tpl', 'tao');
    }
public function resetPassword()
    {
        $this->defaultData();
        $token = $this->getRequestParameter('token');

        $formContainer = new tao_actions_form_ResetUserPassword();
        $form = $formContainer->getForm();

        $form->setValues(array('token'=>$token));

        $user = $this->getPasswordRecovery()->getUser(PasswordRecoveryService::PROPERTY_PASSWORD_RECOVERY_TOKEN, $token);
        if ($user === null) {
            $this->logInfo("Password recovery token not found. Token value: {$token}");
            $this->setData('header', __('User not found'));
            $this->setData('error', __('This password reset link is no longer valid. It may have already been used. If you still wish to reset your password please request a new link'));
            $this->setData('content-template', array('passwordRecovery/password-recovery-info.tpl', 'tao'));
        } else {
            if ($form->isSubmited() && $form->isValid()) {
                $this->getPasswordRecovery()->setPassword($user, $form->getValue('newpassword'));
                $this->logInfo("User {$user->getUri()} has changed the password.");
                $this->setData('info', __("Password successfully changed"));
                $this->setData('content-template', array('passwordRecovery/password-recovery-info.tpl', 'tao'));
            } else {
                $this->setData('form', $form->render());
                $this->setData('content-template', array('passwordRecovery/password-reset.tpl', 'tao'));
            }
        }

        $this->setView('layout.tpl', 'tao');
    }
public function resetPassword ( ) { $ this -> defaultData ( ) ; $ token = $ this -> getRequestParameter ( 'token' ) ; $ formContainer = new tao_actions_form_ResetUserPassword ( ) ; $ form = $ formContainer -> getForm ( ) ; $ form -> setValues ( array ( 'token' => $ token ) ) ; $ user = $ this -> getPasswordRecovery ( ) -> getUser ( PasswordRecoveryService :: PROPERTY_PASSWORD_RECOVERY_TOKEN , $ token ) ; if ( $ user === null ) { $ this -> logInfo ( "Password recovery token not found. Token value: {$token}" ) ; $ this -> setData ( 'header' , __ ( 'User not found' ) ) ; $ this -> setData ( 'error' , __ ( 'This password reset link is no longer valid. It may have already been used. If you still wish to reset your password please request a new link' ) ) ; $ this -> setData ( 'content-template' , array ( 'passwordRecovery/password-recovery-info.tpl' , 'tao' ) ) ; } else { if ( $ form -> isSubmited ( ) && $ form -> isValid ( ) ) { $ this -> getPasswordRecovery ( ) -> setPassword ( $ user , $ form -> getValue ( 'newpassword' ) ) ; $ this -> logInfo ( "User {$user->getUri()} has changed the password." ) ; $ this -> setData ( 'info' , __ ( "Password successfully changed" ) ) ; $ this -> setData ( 'content-template' , array ( 'passwordRecovery/password-recovery-info.tpl' , 'tao' ) ) ; } else { $ this -> setData ( 'form' , $ form -> render ( ) ) ; $ this -> setData ( 'content-template' , array ( 'passwordRecovery/password-reset.tpl' , 'tao' ) ) ; } } $ this -> setView ( 'layout.tpl' , 'tao' ) ; }
Password resrt form

@author Aleh Hutnikau <hutnikau@1pt.com>
@return void
Password resrt form