From: Pierre Habouzit (MadCoder Date: Tue, 11 Jan 2005 11:38:19 +0000 (+0000) Subject: bugfixes + dead code X-Git-Tag: xorg/old~476 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=64032eb397776d25e60c08729365342d0f4763bf;p=platal.git bugfixes + dead code git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-279 --- diff --git a/htdocs/login.php b/htdocs/login.php index 9b9764e..18bc9da 100644 --- a/htdocs/login.php +++ b/htdocs/login.php @@ -22,23 +22,15 @@ 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 diff --git a/htdocs/register/end.php b/htdocs/register/end.php index d0f00af..8bb067c 100644 --- a/htdocs/register/end.php +++ b/htdocs/register/end.php @@ -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')); diff --git a/htdocs/register/index.php b/htdocs/register/index.php index e00452f..a45c506 100644 --- a/htdocs/register/index.php +++ b/htdocs/register/index.php @@ -111,11 +111,10 @@ switch ($sub_state['step']) { if (isset($err)) { $err = join('
', $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 index 5dc1d5b..0000000 --- a/templates/include/form_naissance.tpl +++ /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 * - ***************************************************************************} - -

- Date de naissance -

- -
-

- 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. -

-
- - - - - - - - - - - -
- Date de naissance -
- Date (JJMMAAAA) - - -
- -
-
- -{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/login.tpl b/templates/login.tpl index 3870739..4b996b5 100644 --- a/templates/login.tpl +++ b/templates/login.tpl @@ -19,24 +19,11 @@ ***************************************************************************} -{if $date} -

- Assistant première connexion -

-

- 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. -

-

- Clique ici pour continuer. -

-{elseif $naissance} +{if $ask_naissance} + {include file='include/form_naissance.tpl'} -{else} +{else}

Bienvenue {$smarty.session.prenom} :o)

diff --git a/templates/register/success.tpl b/templates/register/success.tpl index a29b296..4618d87 100644 --- a/templates/register/success.tpl +++ b/templates/register/success.tpl @@ -22,7 +22,7 @@

Tu as maintenant accès au site !!! -Ton adresse électronique à vie {$forlife}@polytechnique.org est déjà ouverte, essaie-la ! +Ton adresse électronique à vie {$smarty.session.forlife}@polytechnique.org est déjà ouverte, essaie-la !

Remarque: m4x.org est un domaine "discret" qui veut dire "mail for X" et