MOD #138 : Stockage des passwords hashés
[cl7.git] / php / panel.php
index 48d9043..d07bb6c 100644 (file)
@@ -18,23 +18,19 @@ class Panel
    function rendre()\r
    {
       # selection de tous les participants
-      $res_SQL = mysql_query("SELECT pseudo FROM participants ORDER BY id");
+      $res_SQL = pg_query("SELECT pseudo FROM participants ORDER BY id");
 
-      echo '<div id="nbParticipants"><em>', mysql_num_rows($res_SQL), '</em> inscrit', (mysql_num_rows($res_SQL) > 1 ? 's' : ''), '</div>';
+      echo '<div id="nbParticipants"><em>', pg_num_rows($res_SQL), '</em> inscrit', (pg_num_rows($res_SQL) > 1 ? 's' : ''), '</div>';
 
       # affichage des participants
-      if (mysql_num_rows($res_SQL) > 0)
+      if (pg_num_rows($res_SQL) > 0)
          echo '<ul id="participants">';
-      for ($i=0; $i<mysql_num_rows($res_SQL); $i++)
-      {
-         mysql_data_seek($res_SQL, $i);
-         $le_participant_pseudo = mysql_fetch_object($res_SQL);
-         echo '<li>', traitement_pre_affichage($le_participant_pseudo->pseudo, 8), '</li>';
-      }
-      if (mysql_num_rows($res_SQL) > 0)
+      while ($participant_pseudo = pg_fetch_object($res_SQL))
+         echo '<li>', traitement_pre_affichage($participant_pseudo->pseudo, 8), '</li>';
+      if (pg_num_rows($res_SQL) > 0)
          echo '</ul>';
 
-      if($this->participant->valide)
+      if($this->participant->existe())
       {
          echo'
          <form method="post" action="index.php?';
@@ -59,7 +55,7 @@ class Panel
          <p>login / pass</p>
          <p><input type="hidden" name="log" value="1" /></p>
          <p><input type="text" name="pseudo" size="10" maxlength="30" /></p>
-         <p><input type="password" name="password" size="10" maxlength="10" /></p>
+         <p><input type="password" name="password" size="10" maxlength="15" /></p>
          <p><input type="submit" value="oki" class="submitInvisible" /></p>
          </form>
          ';