]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php
Empty line removed which causes headers are sent
[shipsimu.git] / application / ship-simu / main / commands / web / class_WebShipsimuGuestLoginCommand.php
index 60d7fa93bccc978c28a4c9f8d26fc32321201ff0..0c9e6cbe60e1e156613eea9e5c3562a648e39551 100644 (file)
@@ -55,26 +55,6 @@ class WebShipsimuGuestLoginCommand extends BaseCommand implements Commandable {
                // Set the resolver instance
                $commandInstance->setResolverInstance($resolverInstance);
 
-               // Get the controller instance from the resolver (breaks MVC pattern again)
-               $controllerInstance = $resolverInstance->getControllerInstance();
-
-               switch ($commandInstance->getConfigInstance()->readConfig('login_type')) {
-                       case "username": // Login via username
-                               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_class'));
-                               break;
-
-                       case "email": // Login via email
-                               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_class'));
-                               break;
-
-                       default: // Wether username or email is set
-                               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_class'));
-                               break;
-               }
-
-               /* @TODO Add more filters */
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_class'));
-
                // Return the prepared instance
                return $commandInstance;
        }
@@ -121,7 +101,23 @@ class WebShipsimuGuestLoginCommand extends BaseCommand implements Commandable {
         * @return      void
         */
        function addExtraFilters (Controller $controllerInstance) {
-               // Empty for now
+               // Which login type do we have?
+               switch ($commandInstance->getConfigInstance()->readConfig('login_type')) {
+                       case "username": // Login via username
+                               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_class'));
+                               break;
+
+                       case "email": // Login via email
+                               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_class'));
+                               break;
+
+                       default: // Wether username or email is set
+                               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_class'));
+                               break;
+               }
+
+               /* @TODO Add more filters */
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_class'));
        }
 }