X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=php%2Fcontroller.php;h=41381ac913c97be33ce092037a8dd05b4b960597;hb=912c54815fb34d93de674af2bcf3acc85ce7421d;hp=f3fd468116dabe77c3b7365fbed0efaabdb4f156;hpb=23bc2016d5fbd8f7daa9b7ba5c7fa862709ff7a7;p=cl7.git diff --git a/php/controller.php b/php/controller.php index f3fd468..41381ac 100644 --- a/php/controller.php +++ b/php/controller.php @@ -48,7 +48,7 @@ class Controller array( $id, $_POST['pseudo'], - $_POST['pass1'], + sha1($_POST['pass1']), $_POST['clan_nom'], $_POST['clan_tag'], $_POST['nom'], @@ -78,7 +78,7 @@ class Controller { pg_query("BEGIN"); pg_query_params("UPDATE participants SET pseudo = $1 WHERE id = $2", array($_POST['pseudo'], $this->participant->info->id)); - pg_query_params("UPDATE participants SET password = $1 WHERE id = $2", array($_POST['pass1'], $this->participant->info->id)); + pg_query_params("UPDATE participants SET password = $1 WHERE id = $2", array(sha1($_POST['pass1']), $this->participant->info->id)); pg_query_params("UPDATE participants SET clan_nom = $1 WHERE id = $2", array($_POST['clan_nom'], $this->participant->info->id)); pg_query_params("UPDATE participants SET clan_tag = $1 WHERE id = $2", array($_POST['clan_tag'], $this->participant->info->id)); pg_query_params("UPDATE participants SET nom = $1 WHERE id = $2", array($_POST['nom'], $this->participant->info->id)); @@ -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); } }