* in a boolean attribute which is then readable by a matching getter.
*
* @param $requestInstance An instance of a Requestable class
+ * @param $responseInstance An instance of a Responseable class
* @return void
* @throws UserLoginMethodException If wether username nor email login
* was detected
* @throws UserPasswordMismatchException If the supplied password did not
* match with the stored password
*/
- public function doLogin (Requestable $requestInstance) {
+ public function doLogin (Requestable $requestInstance, Responseable $responseInstance) {
// By default no method is selected
$method = null;
$data = "";
$helperInstance = ObjectFactory::createObjectByConfiguredName('login_helper', array($requestInstance));
// 2) Execute the login. This will now login...
- $helperInstance->executeLogin();
+ $helperInstance->executeLogin($responseInstance);
+ }
+
+ /**
+ * Determines wether the login was fine. This is done by checking if the 'login' instance is in registry
+ *
+ * @return $loginDone Wether the login was fine or not
+ */
+ public function ifLoginWasSuccessfull () {
+ // Is the registry key there?
+ $loginDone = (Registry::getRegistry()->getInstance('login') instanceof Registerable);
+
+ // Return the result
+ return $loginDone;
}
}