X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fship-simu%2Fmain%2Fcommands%2Fweb%2Fclass_WebShipsimuGuestLoginCommand.php;h=eedc22ce3a5622ca977418aa691dde9e9a606d24;hb=df494d7dff1401830f34852f8bbd74b8b2913dc2;hp=2fd8165f7500c7f9cd33bf729ed46c26e5185a1d;hpb=24c41250dd2af7df792e262e03bca8affcc0e40f;p=shipsimu.git diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php index 2fd8165..eedc22c 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php @@ -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); @@ -98,26 +98,16 @@ class WebShipsimuGuestLoginCommand extends BaseCommand implements Commandable { * Adds extra filters to the given controller instance * * @param $controllerInstance A controller instance + * @param $requestInstance An instance of a class with an Requestable interface * @return void + * @todo Add more filters */ - function addExtraFilters (Controller $controllerInstance) { - // 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; + public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { + // Add username + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_guest_verifier_class')); - 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')); + // Add password verifier filter + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('passwd_guest_verifier_class')); } }