// 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;
}
* @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'));
}
}