source/Application/Controller/ForgotPasswordController.php
public function updatePassword()
    {
        $sNewPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_new', true);
        $sConfPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_new_confirm', true);

        $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);

        /** @var \OxidEsales\Eshop\Core\InputValidator $oInputValidator */
        $oInputValidator = \OxidEsales\Eshop\Core\Registry::getInputValidator();
        if (($oExcp = $oInputValidator->checkPassword($oUser, $sNewPass, $sConfPass, true))) {
            return \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oExcp->getMessage(), false, true);
        }

        // passwords are fine - updating and loggin user in
        if ($oUser->loadUserByUpdateId($this->getUpdateId())) {
            // setting new pass ..
            $oUser->setPassword($sNewPass);

            // resetting update pass params
            $oUser->setUpdateKey(true);

            // saving ..
            $oUser->save();

            // forcing user login
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('usr', $oUser->getId());

            return 'forgotpwd?success=1';
        } else {
            // expired reminder
            $oUtilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView();

            return $oUtilsView->addErrorToDisplay('ERROR_MESSAGE_PASSWORD_LINK_EXPIRED', false, true);
        }
    }
public function updatePassword()
    {
        $sNewPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_new', true);
        $sConfPass = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('password_new_confirm', true);

        $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);

        /** @var \OxidEsales\Eshop\Core\InputValidator $oInputValidator */
        $oInputValidator = \OxidEsales\Eshop\Core\Registry::getInputValidator();
        if (($oExcp = $oInputValidator->checkPassword($oUser, $sNewPass, $sConfPass, true))) {
            return \OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($oExcp->getMessage(), false, true);
        }

        // passwords are fine - updating and loggin user in
        if ($oUser->loadUserByUpdateId($this->getUpdateId())) {
            // setting new pass ..
            $oUser->setPassword($sNewPass);

            // resetting update pass params
            $oUser->setUpdateKey(true);

            // saving ..
            $oUser->save();

            // forcing user login
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('usr', $oUser->getId());

            return 'forgotpwd?success=1';
        } else {
            // expired reminder
            $oUtilsView = \OxidEsales\Eshop\Core\Registry::getUtilsView();

            return $oUtilsView->addErrorToDisplay('ERROR_MESSAGE_PASSWORD_LINK_EXPIRED', false, true);
        }
    }
public function updatePassword ( ) { $ sNewPass = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'password_new' , true ) ; $ sConfPass = \ OxidEsales \ Eshop \ Core \ Registry :: getConfig ( ) -> getRequestParameter ( 'password_new_confirm' , true ) ; $ oUser = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ User :: class ) ; /** @var \OxidEsales\Eshop\Core\InputValidator $oInputValidator */ $ oInputValidator = \ OxidEsales \ Eshop \ Core \ Registry :: getInputValidator ( ) ; if ( ( $ oExcp = $ oInputValidator -> checkPassword ( $ oUser , $ sNewPass , $ sConfPass , true ) ) ) { return \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) -> addErrorToDisplay ( $ oExcp -> getMessage ( ) , false , true ) ; } // passwords are fine - updating and loggin user in if ( $ oUser -> loadUserByUpdateId ( $ this -> getUpdateId ( ) ) ) { // setting new pass .. $ oUser -> setPassword ( $ sNewPass ) ; // resetting update pass params $ oUser -> setUpdateKey ( true ) ; // saving .. $ oUser -> save ( ) ; // forcing user login \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( 'usr' , $ oUser -> getId ( ) ) ; return 'forgotpwd?success=1' ; } else { // expired reminder $ oUtilsView = \ OxidEsales \ Eshop \ Core \ Registry :: getUtilsView ( ) ; return $ oUtilsView -> addErrorToDisplay ( 'ERROR_MESSAGE_PASSWORD_LINK_EXPIRED' , false , true ) ; } }
Checks if password is fine and updates old one with new
password. On success user is redirected to success page

@return string
Checks if password is fine and updates old one with new password . On success user is redirected to success page