public function process($appState, $options = array())
 {
     if (isset($_SESSION)) {
         $session = Security::secure($_SESSION);
         if (isset($session['user']) && isset($session['password'])) {
             if ($this->m_model->getUserPassword($session['user']) == $session['password']) {
                 //	STATE CODE = 2 : USER CONNECTED
                 return 2;
             }
         }
     }
     //	STATE CODE = 1 : NO CONNECTED USER
     return 1;
 }
Пример #2
0
 public function process($appState, $options = array())
 {
     $post = Security::secure($_POST);
     $session = Security::secure($_SESSION);
     if ($_SERVER['REQUEST_METHOD'] == 'GET') {
         if (!isset($_SESSION['formToken'])) {
             $_SESSION['formToken'] = rand();
         }
     } else {
         if (!isset($session['formToken']) || !isset($post['formToken']) || $session['formToken'] != $post['formToken']) {
             header('Status: 403 Forbidden', false, 403);
             exit;
         }
     }
     return $appState;
 }
Пример #3
0
 public function process($appState, $options = array())
 {
     $post = Security::secure($_POST);
     $this->outputs['error'] = false;
     //	We only check the sent data if they exist and if a connected user has not already been detected
     if (!empty($post) && $appState != 2) {
         if ($this->m_model->getUserPassword($post['user']) !== NULL && $this->m_model->getUserPassword($post['user']) == $post['password']) {
             $_SESSION['user'] = $post['user'];
             $_SESSION['password'] = $post['password'];
             //	STATE CODE = 2 : CONNECTED USER
             return 2;
         } else {
             $this->outputs['error'] = true;
             //	STATE CODE = 1 : NO CONNECTED USER
             return 1;
         }
     }
     return $appState;
 }
Пример #4
0
 public function process($appState, $options = array())
 {
     /*if(isset($_SESSION))	{
     				$session = Security::secure($_SESSION);
     
     				if(isset($session['user']) && isset($session['password']))	{
     					if($this->m_model->getUserPassword($session['user']) == $session['password'])	{
     						//	STATE CODE = 2 : USER CONNECTED
     						return 2;
     					}
     				}
     			}*/
     $post = Security::secure($_POST);
     if (isset($post['name'])) {
         if ($post['name'] == '' || $post['first_name'] == '' || $post['mail'] == '' || $post['phone'] == '' || $post['adress'] == '') {
         }
     }
     //	STATE CODE = 1 : NO CONNECTED USER
     return 1;
 }