From bd7154c4565fb68084a210018116944658367525 Mon Sep 17 00:00:00 2001
From: Eliah REBSTOCK <eliah.rebstock@ensiie.fr>
Date: Mon, 9 May 2016 18:11:52 +0200
Subject: [PATCH] plusieurs hotfixes sur le site

---
 app/controller/AdminController.php    | 2 +-
 app/controller/PartieController.php   | 2 +-
 app/view/Includes/header.include.html | 2 +-
 app/view/Index/display.html           | 2 +-
 app/view/Profil/display.html          | 3 ---
 5 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/app/controller/AdminController.php b/app/controller/AdminController.php
index 006d012..e6fb9af 100644
--- a/app/controller/AdminController.php
+++ b/app/controller/AdminController.php
@@ -78,7 +78,7 @@ class AdminController extends Controller {
         if(isset($_FILES['image'])) {
             list($err, $image) = getImage($_FILES['image'], 512, 512);
             if ($err == 0) {
-                saveImage($image, ROOT . "/www/images/jeu/" . $_POST['slug_jeu'] . ".jpg");
+                saveImage($image, ROOT . "/www/images/jeu/" . $slug . ".jpg");
             } elseif($err == 2) {
                 $_SESSION["addRequestErrCode"] = $err; // on stocke le code d'erreur
                 header('Location:../modif'); // on redirige vers la page de formulaire (il faut faire un retour dans le dossier parent pour que ça fonctionne)
diff --git a/app/controller/PartieController.php b/app/controller/PartieController.php
index b278b3f..745cf54 100644
--- a/app/controller/PartieController.php
+++ b/app/controller/PartieController.php
@@ -401,7 +401,7 @@ class PartieController extends Controller
                 self::error("<h1>Erreur : il n'y a pas assez d'équipes.</h1>", "stepe1");
 				die();
             }
-            if (count($equipes) > $jeu_actuel->max_equipes) {
+            if (count($equipes) > $jeu_actuel->max_equipes && !is_null($jeu_actuel->max_equipes)) {
                 self::error("<h1>Erreur : il y a trop d'équipes.</h1>", "stepe1");
 				die();
             }
diff --git a/app/view/Includes/header.include.html b/app/view/Includes/header.include.html
index eaeec7f..e765a62 100644
--- a/app/view/Includes/header.include.html
+++ b/app/view/Includes/header.include.html
@@ -15,7 +15,7 @@ if(!isset($_SESSION)) { // si
     <link href='https://fonts.googleapis.com/css?family=Work+Sans' rel='stylesheet' type='text/css'>
 	
 	
-	<script>var BASE_URL = 'http://localhost/projet-web-2016/www';</script>
+	<script>var BASE_URL = '<?php echo BASE_URL; ?>';</script>
 	<script src="<?php echo BASE_URL; ?>/js/jquery.min.js"></script>
 	<script src="<?php echo BASE_URL; ?>/js/jquery.auto-complete.min.js"></script>
 	<script src="<?php echo BASE_URL; ?>/js/autocompletion_form_jeux.js"></script>
diff --git a/app/view/Index/display.html b/app/view/Index/display.html
index 87a7ff0..8cc6f53 100644
--- a/app/view/Index/display.html
+++ b/app/view/Index/display.html
@@ -27,7 +27,7 @@
         <div class="col-6">
             <h3 class="stat-title">Dernier inscrit :</h3>
 			<aside class="profil-image"><a href="<?php echo BASE_URL; ?>/profil/<?php echo $this->last_member->slug; ?>">
-				<img src="<?php echo BASE_URL; ?>/images/profil_42.jpg" alt="Photo de profil de phoenix" />
+				<img src="<?php echo BASE_URL; ?>/images/avatar/<?php echo $this->last_member->slug; ?>.jpg" alt="Photo de profil de phoenix" />
                 </a>
 			</aside>
 			<ul class="col-4 pref">
diff --git a/app/view/Profil/display.html b/app/view/Profil/display.html
index 8bbf2e2..8c53c22 100644
--- a/app/view/Profil/display.html
+++ b/app/view/Profil/display.html
@@ -15,9 +15,6 @@
 				<?php 
 				if(isset($_SESSION['connected']) && $_SESSION['connected'] == true) {
 				?>
-				<li>24 ans</li>
-				<li>ENSIIE</li>
-				<li>1A+++</li>
 				<li><?php echo $this->profil->email; ?></li>
 			</ul>
 			<ul class="col-4 pref">
-- 
GitLab