Beispiel #1
0
 public function __destruct()
 {
     // static elements are deleted automatically at the end of the PHP script,
     // so there is no need to destroy this singleton explicitly
     if (!is_null(self::$instance)) {
         $this->close();
         // close the database connection
         self::$instance = null;
     }
 }
Beispiel #2
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;
 }
Beispiel #3
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();
     }
 }
Beispiel #4
0
 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 make()
 {
     parent::make();
     $this->listContent();
 }
Beispiel #6
0
 public function __construct()
 {
     $this->modelCore = ModelCore::getInstance();
     $this->loader = new Twig_Loader_Filesystem('templates');
     $this->twig = new Twig_Environment($this->loader, array());
 }
 public function make()
 {
     parent::make();
 }
 public function __construct(Request $request)
 {
     parent::__construct($request);
     $this->initBlock();
 }