]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php
Several fixes (new class/filters) for guest login
[shipsimu.git] / application / ship-simu / main / commands / web / class_WebShipsimuGuestLoginCommand.php
index 9d747de6b100eb484f7a4bdc2b0add9617c1ff44..eedc22ce3a5622ca977418aa691dde9e9a606d24 100644 (file)
@@ -74,7 +74,7 @@ class WebShipsimuGuestLoginCommand extends BaseCommand implements Commandable {
                $loginInstance->setRequestInstance($requestInstance);
 
                // Encrypt the password
-               $loginInstance->encryptPassword('pass');
+               $loginInstance->encryptPassword('passwd');
 
                // Do the login here
                $loginInstance->doLogin($requestInstance, $responseInstance);
@@ -103,23 +103,11 @@ class WebShipsimuGuestLoginCommand extends BaseCommand implements Commandable {
         * @todo        Add more filters
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
-               // Which login type do we have?
-               switch ($this->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;
-               }
+               // Add username
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_guest_verifier_class'));
 
                // Add password verifier filter
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_class'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('passwd_guest_verifier_class'));
        }
 }