示例#1
0
 public function pass()
 {
     $data = NULL;
     //Modification du mot de passe.
     if (isset($_POST['editPass'])) {
         if ($_SESSION['form_timer'] + 600 > time()) {
             parent::model('accounts');
             $model = new accounts();
             try {
                 $model->UpdatePw($_SESSION['ID'], $_POST['password']);
                 $data['alert'] = "alert-success";
                 $data['message'] = "Le mot de passe a été changé.";
             } catch (PDOexception $ex) {
                 $data['alert'] = "alert-warning";
                 $data['message'] = "Le mot de passe n'a pas été changé.";
             }
         } else {
             $data['alert'] = "alert-warning";
             $data['message'] = "La permission du formulaire a expiré.";
         }
     }
     parent::view("shared/header");
     parent::view("intern/menu");
     parent::view('intern/pass', $data);
     parent::view('shared/footer');
 }