public function view() { $Security = new Security(); $Security->logout(); header('Location:/authentication'); return $this->render("usability:authentication.html"); }
public function view() { $Security = new Security(); if (!$Security->login()) { $Security->errorNumber; } else { header('Location:/safesite'); } return $this->render("usability:authentication.html"); }
/** * * The handleSecurity Function checks if the User is loggedIn and headers to the defined redirectTo * * @return boolean */ private function handleSecurity() { $securityObject = new Security(); $loggedIn = $securityObject->login(); if (!$loggedIn) { //redirect to defined $securityConfig = Config::securityConfig(); if ($key !== $securityConfig['redirectTo']) { $redirectAddress = trim(Config::routing()[$securityConfig['redirectTo']]['pattern'], '/'); header('Location:/' . $redirectAddress); } else { //throw exceptions } } return true; }