X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=blobdiff_plain;f=application%2Fship-simu%2Fmain%2Flogin%2Fclass_ShipSimuUserLogin.php;h=59ddcdcb6b9f8619191dbabb3aeb1732281d0aaa;hp=a043de8ba74c0ed28cedc5ab4621ebdcd608ab6c;hb=1c3a46c869307f45e3c456254b086503600f8602;hpb=55b327a3f5f2fe1d244532e07be7444e94b2a768;ds=sidebyside diff --git a/application/ship-simu/main/login/class_ShipSimuUserLogin.php b/application/ship-simu/main/login/class_ShipSimuUserLogin.php index a043de8..59ddcdc 100644 --- a/application/ship-simu/main/login/class_ShipSimuUserLogin.php +++ b/application/ship-simu/main/login/class_ShipSimuUserLogin.php @@ -61,6 +61,7 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser { * 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 @@ -69,7 +70,7 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser { * @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 = ""; @@ -118,7 +119,20 @@ class ShipSimuUserLogin extends BaseFrameworkSystem implements LoginableUser { $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; } }