MOD #134
[cl7.git] / php / controller.php
index cad4352..41381ac 100644 (file)
@@ -96,7 +96,7 @@ class Controller
          }
       }
       # vote pour des jeux (autorisé même lorsque les inscriptions sont terminées)
-      else if (isset($_POST['set_jeux_joues']) && $this->participant->existe())
+      else if (isset($_POST['set_jeux_joues']) && $this->participant->existe() && !$config->get("inscription_terminees"))
       {
          $votes = $_POST['votes'];
          if (!$votes)
@@ -121,7 +121,8 @@ class Controller
                pg_query("BEGIN");
                $res = pg_query_params("SELECT id FROM jeux WHERE nom = $1", array($jeu));
                if ($id = pg_fetch_object($res))
-                  array_unshift($votes, $id->id);
+                  if (!in_array($id->id, $votes))
+                     array_unshift($votes, $id->id);  
             }
          }