// Import framework stuff
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
+use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Helper\Crypto\CryptoHelper;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
use Org\Mxchange\CoreFramework\User\BaseUser;
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
*
* @return void
*/
- protected function __construct () {
+ private function __construct () {
// Call parent constructor
parent::__construct(__CLASS__);
}
// Is the password still not set?
if (is_null($password)) {
// Not found in form so stop the filtering process
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('password_unset');
// Abort here
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
- } // END - if
- } // END - if
+ }
+ }
if (empty($password)) {
// Password is empty
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('password_empty');
// Abort here
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
- } // END - if
+ }
// Get a user instance
- $userInstance = GenericRegistry::getRegistry()->getInstance('user');
+ $userInstance = ObjectRegistry::getRegistry('generic')->getInstance('user');
// Get current hash
$currentHash = $userInstance->getField('pass_hash');
// Get an encryption helper and encrypt the password
- $passHash = ObjectFactory::createObjectByConfiguredName('crypto_class')->hashString($password, $currentHash);
+ $passHash = CryptoHelper::getSelfInstance()->hashString($password, $currentHash);
// Does it match?
if ($currentHash != $passHash) {
// Throw an exception here to stop the proccessing
throw new AccountPasswordMismatchException($this, BaseUser::EXCEPTION_USER_PASS_MISMATCH);
- } // END - if
+ }
}
}