X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Ffilter%2Fchange%2Fclass_PasswordChangeFilter.php;h=49c7076a2399bcdf35b2f8cd6ea302ce2d036ec7;hb=4d92fa6063058d861ffd7b82d0fb8dd58ffc1d27;hp=a3ccfb820d188df214af4a7900e687ae3c8754ea;hpb=a32ed62f6efccd13c99fded2323665520d12bcd5;p=core.git diff --git a/framework/main/classes/filter/change/class_PasswordChangeFilter.php b/framework/main/classes/filter/change/class_PasswordChangeFilter.php index a3ccfb82..49c7076a 100644 --- a/framework/main/classes/filter/change/class_PasswordChangeFilter.php +++ b/framework/main/classes/filter/change/class_PasswordChangeFilter.php @@ -1,20 +1,21 @@ * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * @@ -37,7 +38,7 @@ class PasswordChangeFilter extends BaseFilter implements Filterable { * * @return void */ - protected function __construct () { + private function __construct () { // Call parent constructor parent::__construct(__CLASS__); } @@ -73,47 +74,47 @@ class PasswordChangeFilter extends BaseFilter implements Filterable { // Is only first email set? if ((!empty($pass1)) && (empty($pass2))) { // Request is invalid! - $requestInstance->requestIsValid(FALSE); + $requestInstance->setIsRequestValid(FALSE); // Email 2 is empty $responseInstance->addFatalMessage('pass2_empty'); // Stop processing here throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); - } // END - if + } // Is only second pass set? if ((empty($pass1)) && (!empty($pass2))) { // Request is invalid! - $requestInstance->requestIsValid(FALSE); + $requestInstance->setIsRequestValid(FALSE); // Email 1 is empty $responseInstance->addFatalMessage('pass1_empty'); // Stop processing here throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); - } // END - if + } // Are password and confirmation empty? if ((empty($pass1)) && (empty($pass2))) { // Don't change password here - return TRUE; - } // END - if + return true; + } // Do both match? if ($pass1 != $pass2) { // Request is invalid! - $requestInstance->requestIsValid(FALSE); + $requestInstance->setIsRequestValid(FALSE); // Emails are mismatching $responseInstance->addFatalMessage('pass_mismatch'); // Stop processing here throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); - } // END - if + } // Now, get a user instance for comparison - $userInstance = Registry::getRegistry()->getInstance('user'); + $userInstance = GenericRegistry::getRegistry()->getInstance('user'); // Update the "password" field $this->partialStub('Unfinished part.');