예제 #1
0
 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;
 }
예제 #2
0
 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();
     }
 }
예제 #3
0
파일: Form.php 프로젝트: alican/HalloPizza
 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
 }
예제 #4
0
파일: Model.php 프로젝트: alican/HalloPizza
 public function __construct()
 {
     $this->modelCore = ModelCore::getInstance();
     $this->loader = new Twig_Loader_Filesystem('templates');
     $this->twig = new Twig_Environment($this->loader, array());
 }