diff --git a/controleur/FrontControler.php b/controleur/FrontControler.php index 3107a26..e6b791d 100644 --- a/controleur/FrontControler.php +++ b/controleur/FrontControler.php @@ -4,13 +4,12 @@ require_once('controleur/gest.php'); class FrontControler { private $actions = array( - "Gest" => ["wantToConnect"], + "Gest" => ["wantToConnect", 'connecting', 'wantToSignIn', 'signIn'], ); function start() { - session_start(); $action = $_REQUEST['action']; - if(in_array($action, $this->action['Gest'])){ + if(in_array($actions, $this->action['Gest'])){ $controleur = new GestControler(); }else{ $controleur = new GestControler(); diff --git a/controleur/gest.php b/controleur/gest.php index 45550d9..da50291 100644 --- a/controleur/gest.php +++ b/controleur/gest.php @@ -3,9 +3,25 @@ class GestControler { function __construct() { try{ + $m = new ModelGest(); $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : "default"; switch($action){ + case "connecting": + $username = $_REQUEST['username']; + $password = $_REQUEST['password']; + $m->connect($username, $password); + break; + case "wantToSignIn": + require('vues/signin.php'); + break; + case "signin": + $username = $_REQUEST['username']; + $password = $_REQUEST['password']; + $password2 = $_REQUEST['password2']; + $ case "wantToConnect": + $m->signin($username, $password, $password2); + break; default: require("vues/connect.php"); break; diff --git a/index.php b/index.php index dacf7da..e0a53f8 100644 --- a/index.php +++ b/index.php @@ -1,3 +1,5 @@ + + diff --git a/vues/connect.php b/vues/connect.php index b2d6bda..6cb9269 100644 --- a/vues/connect.php +++ b/vues/connect.php @@ -4,9 +4,11 @@ -
+
+
+ S'inscrire diff --git a/vues/signin.php b/vues/signin.php new file mode 100644 index 0000000..3e6f224 --- /dev/null +++ b/vues/signin.php @@ -0,0 +1,12 @@ + + S'inscrire + + + +
+ + + + +
+