diff --git a/project/src/.idea/.gitignore b/project/src/.idea/.gitignore
deleted file mode 100755
index 73f69e0..0000000
--- a/project/src/.idea/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
-# Editor-based HTTP Client requests
-/httpRequests/
diff --git a/project/src/.idea/modules.xml b/project/src/.idea/modules.xml
deleted file mode 100755
index f669a0e..0000000
--- a/project/src/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/project/src/.idea/php.xml b/project/src/.idea/php.xml
deleted file mode 100755
index 805c0e0..0000000
--- a/project/src/.idea/php.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/project/src/.idea/src.iml b/project/src/.idea/src.iml
deleted file mode 100755
index 330c018..0000000
--- a/project/src/.idea/src.iml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/project/src/.idea/vcs.xml b/project/src/.idea/vcs.xml
deleted file mode 100755
index b2bdec2..0000000
--- a/project/src/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/project/src/config/config.php b/project/src/config/config.php
index 2429345..53f8602 100755
--- a/project/src/config/config.php
+++ b/project/src/config/config.php
@@ -11,9 +11,9 @@ $rep=__DIR__.'/../';
//BD
-$base = 'mysql:host=londres.uca.local;dbname=dbrebeuret';
-$login = 'rebeuret';
-$mdp = 'achanger';
+$base = 'mysql:host=localhost;dbname=sae';
+$login = 'root';
+$mdp = '';
//Vues
$vues['index']='vues/index.php';
diff --git a/project/src/controller/FrontController.php b/project/src/controller/FrontController.php
index 5a68fd6..f6eb100 100755
--- a/project/src/controller/FrontController.php
+++ b/project/src/controller/FrontController.php
@@ -15,20 +15,16 @@ class FrontController
global $login;
global $mdp;
global $base;
+ global $basePath;
$con = new Connection($base, $login, $mdp);
//altorouter
$router = new \AltoRouter();
- $router->setBasePath('~rebeuret/ScienceQuest/Project/src/');
+ $router->setBasePath('ScienceQuest/Project/src/');
$router->map('GET|POST','/[a:action]?','UserController');
$router->map('GET|POST','/admin/[a:action]','AdminController');
- // $router->map('GET|POST', '/', 'null');
- // $router->map('GET|POST', '/join', 'join');
- // $router->map('GET|POST', '/create', 'create');
- // $router->map('GET|POST', '/login', 'login');
- // $router->map('GET|POST', '/admin/[a:action]?', 'admin');
$router->map('GET|POST', '/validationFormulaire', 'validationFormulaire');
$router->map('GET|POST', '/logout', 'disconnect');
@@ -36,6 +32,7 @@ class FrontController
// Tableau qui contient les messages d'erreur
$dVueErreur = [];
$dVue = [];
+ $dVue['basePath'] = $basePath;
session_start();
@@ -48,7 +45,6 @@ class FrontController
if (!$match) {
throw new \Exception('Wrong call');
}
- $action=$match['params']['action'] ?? "";
switch($match['target']) {
case 'UserController':
@@ -74,6 +70,7 @@ class FrontController
}
} catch (\PDOException $e) {
$dVueErreur[] = 'Erreur avec la base de données !';
+ $dVueErreur[] = $e->getMessage();
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
} catch (LoginException $e) {
echo $twig->render('erreur.html', ['dVueErreur' => $dVueErreur]);
diff --git a/project/src/controller/UserController.php b/project/src/controller/UserController.php
index ad9ab39..1784be0 100755
--- a/project/src/controller/UserController.php
+++ b/project/src/controller/UserController.php
@@ -20,8 +20,8 @@ class UserController {
global $mdp;
$con = new Connection($base, $login, $mdp);
-
$gg = new GameGateway($con);
+
if(!isset($_REQUEST['code'])) {
echo $twig->render('join.html');
} elseif (empty($_REQUEST['code']) || !sizeof($gg->getGameByCode($_REQUEST['code']))) {
@@ -34,8 +34,7 @@ class UserController {
public function accueil(array $params) {
global $twig;
- global $dVue;
- echo $twig->render('accueil.html',['dVue' => $dVue]);
+ echo $twig->render('accueil.html');
}
}
\ No newline at end of file
diff --git a/project/src/templates/join.html b/project/src/templates/join.html
index f85296f..ab9f92d 100755
--- a/project/src/templates/join.html
+++ b/project/src/templates/join.html
@@ -15,6 +15,13 @@
+
+ {% if dErreur is defined %}
+ {% for err in dErreur %}
+
{{ err }}
+ {% endfor %}
+ {% endif %}
+