namespace Org\Mxchange\CoreFramework\Filter\Verifier\User;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
+use Org\Mxchange\CoreFramework\Filter\Chain\FilterChainException;
use Org\Mxchange\CoreFramework\Filter\Filterable;
-use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Response\Responseable;
*
* @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 username set?
if (is_null($userName)) {
// Not found in form so stop the filtering process
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_guest_unset');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif (empty($userName)) {
// Empty field!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_guest_empty');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ($this->ifUserGuestIsTaken($userName) === false) {
// Username is already taken
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_guest_not_found');
* @param $userName Username to check for existence
* @return $alreadyTaken Whether the username has been taken
*/
- private function ifUserGuestIsTaken ($userName) {
+ private function ifUserGuestIsTaken (string $userName) {
// Default is already taken
$alreadyTaken = true;
$userInstance = NULL;
// Get a registry instance
- $registry = GenericRegistry::getRegistry();
+ $registryInstance = ObjectRegistry::getRegistry('generic');
// Is the user already there?
- if ($registry->instanceExists('user')) {
+ if ($registryInstance->instanceExists('user')) {
// Use the instance for checking for the email
- $userInstance = $registry->getInstance('user');
+ $userInstance = $registryInstance->getInstance('user');
$userInstance->setUserGuest($userName);
} else {
// If this instance is created then the username *does* exist
try {
// Get a new instance
- $userInstance = call_user_func_array(array($this->getConfigInstance()->getConfigEntry('guest_class'), 'createGuestByUsername'), array($userName));
+ $userInstance = call_user_func_array(array(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_class'), 'createGuestByUsername'), array($userName));
// Remember this user instance in our registry for later usage
- $registry->addInstance('user', $userInstance);
+ $registryInstance->addInstance('user', $userInstance);
} catch (UsernameMissingException $e) {
// User was not found
}