diff --git a/controller/UserCtrl.php b/controller/UserCtrl.php index 3c96233..40be171 100644 --- a/controller/UserCtrl.php +++ b/controller/UserCtrl.php @@ -12,20 +12,23 @@ class UserCtrl $action=$_REQUEST['action']; switch($action){ - // // voir les listes privees - // case 'voir_liste_priv': - // $this->loadListePriv(); - // break; + // voir les listes privees + case 'voir_liste_priv': + $this->loadListePriv(); + break; - // // ajouter une liste privee - // case 'creer_liste_priv': - // $this->newListPrivate(); - // break; + // ajouter une liste privee + case 'creer_liste_priv': + $this->newListPrivate(); + break; + case 'deconnexion': + $this->deconnexion(); + break; - // } - // } catch(Exception $e) { - // require("../view/erreur.php"); - // } + } + } catch(Exception $e) { + require("../view/erreur.php"); + } } public function loadListePriv(){ @@ -35,7 +38,7 @@ class UserCtrl var_dump($TabTask); // $TabList[] = new ListTask(0, "Projet PHP"); // $TabList[] = new ListTask(1, "Projet Blazor"); - $TabListPriv = $this->taskmodel->getPrivateList(); + $TabListPriv = $this->taskmodel->loadPrivateLists($user); require("../view/liste.php"); } @@ -44,5 +47,10 @@ class UserCtrl insertL(new ListTask(0, $nom, $_SESSION['login'])); require("../view/liste.php"); } + + public function deconnexion(){ + $usrmodel->deconnexion(); + + } } ?> diff --git a/model/TaskModel.php b/model/TaskModel.php index b3ea54b..980f105 100644 --- a/model/TaskModel.php +++ b/model/TaskModel.php @@ -43,7 +43,7 @@ class TaskModel /* LIST FUNCTIONS */ public function addList($id,$nom,$owner="",$dc=0) { - $l = new ListTask($id,$nom,$owner="",$dc=0); + $l = new ListTask($id,$nom,$owner,$dc); $this->gtw->insertL($l); // retourne quoi? con->lastInsertId() ?? } diff --git a/tests/credentials.php b/tests/credentials.php index e7d7377..ae601d6 100644 --- a/tests/credentials.php +++ b/tests/credentials.php @@ -1,4 +1,4 @@ diff --git a/tests/test.php b/tests/test.php index 22e10c0..7ed2df7 100644 --- a/tests/test.php +++ b/tests/test.php @@ -11,7 +11,7 @@ echo "