]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/filter/auth/class_UserAuthFilter.php
Continued:
[core.git] / framework / main / classes / filter / auth / class_UserAuthFilter.php
index bfc185afafaa647ce014829eb07d4e26ae382c04..c45ac7151fe287e39cfe2bb2ecce3f2f6064cc07 100644 (file)
@@ -3,7 +3,8 @@
 namespace Org\Mxchange\CoreFramework\Filter\User\Auth;
 
 // Import framework stuff
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filter\BaseFilter;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Loader\NoClassException;
@@ -17,7 +18,7 @@ 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 - 2022 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -48,7 +49,7 @@ class UserAuthFilter extends BaseFilter implements Filterable {
         *
         * @return      void
         */
-       protected function __construct () {
+       private function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -75,7 +76,7 @@ class UserAuthFilter extends BaseFilter implements Filterable {
         * @return      void
         */
        protected function setDefaultAuthMethod () {
-               $this->authMethod = $this->getConfigInstance()->getConfigEntry('auth_method_class');
+               $this->authMethod = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('auth_method_class');
        }
 
        /**
@@ -102,31 +103,31 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                        $authInstance->destroyAuthData();
 
                        // Mark the request as invalid
-                       $requestInstance->requestIsValid(false);
+                       $requestInstance->setIsRequestValid(FALSE);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('auth_data_incomplete');
 
                        // Stop here
                        throw new UserAuthorizationException($this, self::EXCEPTION_AUTH_DATA_INVALID);
-               } // END - if
+               }
 
                // Regular user account
-               $className = $this->getConfigInstance()->getConfigEntry('user_class');
+               $className = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_class');
                $methodName = 'createMemberByUserName';
 
                // Now, try to get a user or guest instance
-               if ($authLogin == $this->getConfigInstance()->getConfigEntry('guest_login_user')) {
+               if ($authLogin == FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_login_user')) {
                        // Set class
-                       $className = $this->getConfigInstance()->getConfigEntry('guest_class');
+                       $className = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('guest_class');
                        $methodName = 'createGuestByUserName';
-               } // END - if
+               }
 
                // Does the guest class exist?
                if (!class_exists($className)) {
                        // Then abort here
                        throw new NoClassException (array($this, $className), self::EXCEPTION_CLASS_NOT_FOUND);
-               } // END - if
+               }
 
                // Now try the dynamic login
                $userInstance = call_user_func_array(array($className, $methodName), array($authLogin));
@@ -135,11 +136,11 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                if ($userInstance->getPasswordHash() !== $authHash) {
                        // Mismatching password
                        throw new UserPasswordMismatchException(array($this, $userInstance), BaseUser::EXCEPTION_USER_PASS_MISMATCH);
-               } // END - if
+               }
 
                // Remember auth and user instances in registry
-               Registry::getRegistry()->addInstance('auth', $authInstance);
-               Registry::getRegistry()->addInstance('user', $userInstance);
+               GenericRegistry::getRegistry()->addInstance('auth', $authInstance);
+               GenericRegistry::getRegistry()->addInstance('user', $userInstance);
        }
 
 }