Exemplo n.º 1
0
 public function securePost()
 {
     if ($this->isPost()) {
         $csrf = Session::get('skankydev.form.csrf');
         $this->data = (object) $_POST;
         if ($csrf) {
             $token = $_POST['_token'];
             if (!$csrf->checkValue($token) || !$csrf->checkTime()) {
                 throw new Exception("CRSF error", 500);
                 //dont throw exeption in construct;
             } else {
                 unset($this->data->_token);
             }
         }
     }
 }
Exemplo n.º 2
0
 public function setBackLink()
 {
     if (!Session::get('skankydev.backlink')) {
         Session::set('skankydev.backlink', $this->historique->comeFrom());
     }
 }
Exemplo n.º 3
0
 public function __construct()
 {
     $this->messages = Session::get('FlashMessage');
 }
Exemplo n.º 4
0
 /**
  * get previe page
  * @return array the historique
  */
 function comeFrom()
 {
     return Session::get('skankydev.historique.1');
 }