private function testSession($page) { $modelCore = ModelCore::getInstance(); if ($page == "Logout") { // request for logout $modelCore->logOut(); // close the session } if (!$modelCore->isLoggedIn() && $page != "Select") { $page = "Login"; } return $page; }
protected function controller_processReceivedForm() { if (isset($_REQUEST['loginName']) && $_REQUEST['loginName']) { if (isset($_REQUEST['loginPass']) && $_REQUEST['loginPass']) { ModelCore::getInstance()->logIn($_REQUEST['loginName'], $_REQUEST['loginPass']); if (!ModelCore::getInstance()->isLoggedIn()) { throw new UserException("Benutzername oder Passwort sind ungültig."); } } else { throw new UserException("Bitte geben Sie das Passwort ein!"); } } else { throw new UserException(); } }
public final function controller_processReceivedData() { $this->model->setTransientData("saveReceivedData", $_REQUEST); if ($this->refreshEnabled) { // this form can be refreshed; no TAN is included $this->controller_processWithException(); } else { if (isset($_POST["TAN"])) { if ($_POST["TAN"] == ModelCore::getInstance()->getTAN()) { // TAN has been verified $this->controller_processWithException(); } else { throw new UserException("Diese Daten hatten Sie bereits übermittelt", $_REQUEST["formPage"]); } } else { if ($this->dataRequiredFromPage) { // a TAN is required, but none has been submitted throw new UserException("", $this->dataRequiredFromPage); } } } $this->model->setTransientData("saveReceivedData", null); // discard; no UserException occurred }
public function __construct() { $this->modelCore = ModelCore::getInstance(); $this->loader = new Twig_Loader_Filesystem('templates'); $this->twig = new Twig_Environment($this->loader, array()); }