bugfixes + dead code
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Tue, 11 Jan 2005 11:38:19 +0000 (11:38 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:27:25 +0000 (23:27 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-279

htdocs/login.php
htdocs/register/end.php
htdocs/register/index.php
templates/include/form_naissance.tpl [deleted file]
templates/login.tpl
templates/register/success.tpl

index 9b9764e..18bc9da 100644 (file)
 require_once('xorg.inc.php');
 new_skinned_page('login.tpl', AUTH_COOKIE);
 
-$res = $globals->xdb->query('SELECT date,naissance FROM auth_user_md5 WHERE user_id={?}', Session::getInt('uid'));
-list($date,$naissance) = $res->fetchOneRow();
-
-if ($naissance==0 || $naissance=='0000-00-00')  {
-    $page->assign('ask_naissance', true);
-    $page->run('ask-naissance');
-    exit;
-}
+$res = $globals->xdb->query('SELECT date FROM auth_user_md5 WHERE user_id={?}', Session::getInt('uid'));
+list($date) = $res->fetchOneRow();
 
 // incitation à mettre à jour la fiche
 
-$res = $globals->xdb->query('SELECT date FROM auth_user_md5 WHERE user_id={?}', Session::getInt('uid'));
-$d   = $res->fetchOneCell();
-$d2  = mktime(0, 0, 0, substr($d, 5, 2), substr($d, 8, 2), substr($d, 0, 4));
+$d2  = mktime(0, 0, 0, substr($date, 5, 2), substr($date, 8, 2), substr($date, 0, 4));
 if( (time() - $d2) > 60 * 60 * 24 * 400 ) {
     // si fiche date de + de 400j;
-    $page->assign('fiche_incitation', $d);
+    $page->assign('fiche_incitation', $date);
 }
 
 // incitation à mettre une photo
index d0f00af..8bb067c 100644 (file)
@@ -25,8 +25,7 @@ require_once('user.func.inc.php');
 
 if (Env::has('hash')) {
     $res = $globals->xdb->query(
-            "SELECT  r.uid, r.forlife, r.bestalias, r.mailorg2, r.password, r.email, r.relance, r.naissance,
-                     u.prenom, u.nom, u.promo
+            "SELECT  r.uid, r.forlife, r.bestalias, r.mailorg2, r.password, r.email, r.naissance, u.nom, u.prenom, u.promo
                FROM  register_pending AS r
          INNER JOIN  auth_user_md5    AS u ON r.uid = u.user_id
               WHERE  hash={?} AND hash!='INSCRIT'", Env::get('hash'));
index e00452f..a45c506 100644 (file)
@@ -111,11 +111,10 @@ switch ($sub_state['step']) {
             if (isset($err)) {
                 $err = join('<br />', $err);
             } else {
-                $birth = sprintf("%s-%s-%s", substr(Env::get('naissance'),4,4),
-                        substr(Env::get('naissance'),2,2), substr(Env::get('naissance'),0,2));
-                $sub_state['step']      = 4;
+                $birth = Env::get('naissance');
+                $sub_state['naissance'] = sprintf("%s-%s-%s", substr($birth,4,4), substr($birth,2,2), substr($birth,0,2));
                 $sub_state['email']     = Post::get('email');
-                $sub_state['naissance'] = $birth;
+                $sub_state['step']      = 4;
                 finish_ins($sub_state);
             }
         }
diff --git a/templates/include/form_naissance.tpl b/templates/include/form_naissance.tpl
deleted file mode 100644 (file)
index 5dc1d5b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-{***************************************************************************
- *  Copyright (C) 2003-2004 Polytechnique.org                              *
- *  http://opensource.polytechnique.org/                                   *
- *                                                                         *
- *  This program is free software; you can redistribute it and/or modify   *
- *  it under the terms of the GNU General Public License as published by   *
- *  the Free Software Foundation; either version 2 of the License, or      *
- *  (at your option) any later version.                                    *
- *                                                                         *
- *  This program is distributed in the hope that it will be useful,        *
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
- *  GNU General Public License for more details.                           *
- *                                                                         *
- *  You should have received a copy of the GNU General Public License      *
- *  along with this program; if not, write to the Free Software            *
- *  Foundation, Inc.,                                                      *
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
- ***************************************************************************}
-
-<h1>
-  Date de naissance
-</h1>
-
-<form action="profil2.php" method="post">
-  <p>
-  Avant d'accéder à ton profil pour la première fois, tu dois donner 
-  ta date de naissance au format JJMMAAAA. Elle ne sera plus demandée
-  par la suite et ne pourra être changée. Elle servira en cas de
-  perte du mot de passe comme sécurité supplémentaire, et uniquement 
-  à cela. Elle n'est jamais visible ou lisible.
-  </p>
-  <br />
-  <table class="tinybicol" cellpadding="4" cellspacing="0"  summary="Formulaire de naissance">
-    <tr>
-      <th colspan="2">
-        Date de naissance
-      </th>
-    </tr>
-    <tr>
-      <td>
-        <strong>Date</strong> (JJMMAAAA)
-      </td>
-      <td>
-        <input type="text" size="8" maxlength="8" name="birth" />
-      </td>
-    </tr>
-    <tr>
-      <td class="center" colspan="2">
-        <input type="submit" value="Enregistrer" name="submit" />
-      </td>
-    </tr>
-  </table>
-</form>
-
-{* vim:set et sw=2 sts=2 sws=2: *}
index 3870739..4b996b5 100644 (file)
  ***************************************************************************}
 
 
-{if $date}
-  <h1>
-    Assistant première connexion
-  </h1>
-  <p>
-  Le programme a détecté que tu te connectes pour la première fois
-  sur ce site. Un certain nombre de paramètres ne sont donc pas à
-  jour pour fonctionner correctement. La plupart se mettront eux-mêmes
-  à jour sans que tu t'en aperçoives, mais d'autres nécessitent
-  ton intervention.
-  </p>
-  <p style="margin-top: 3em;">
-    <a href="profil.php">Clique ici pour continuer.</a>
-  </p>
-{elseif $naissance}
+{if $ask_naissance}
+
 {include file='include/form_naissance.tpl'}
-{else}
 
+{else}
 
 <h1>Bienvenue {$smarty.session.prenom} :o)</h1>
 
index a29b296..4618d87 100644 (file)
@@ -22,7 +22,7 @@
 
 <p>
 Tu as maintenant accès au site !!!
-Ton adresse électronique à vie <strong>{$forlife}@polytechnique.org</strong> est déjà ouverte, essaie-la !
+Ton adresse électronique à vie <strong>{$smarty.session.forlife}@polytechnique.org</strong> est déjà ouverte, essaie-la !
 </p>
 <p>
   Remarque: m4x.org est un domaine "discret" qui veut dire "mail for X" et