From cc5a326725d1fa1433db96bb03066027ea1297ee Mon Sep 17 00:00:00 2001 From: "Pierre Habouzit (MadCoder" Date: Mon, 10 Jan 2005 08:12:30 +0000 Subject: [PATCH] begin to work on new registration git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-255 --- hooks/tmp.inc.php | 2 +- htdocs/inscription/index.php | 26 --- htdocs/inscription/maj.php | 66 ------ htdocs/inscription/step1.php | 29 --- htdocs/inscription/step2.php | 36 ---- htdocs/inscription/step3.php | 88 -------- htdocs/register/index.php | 102 +++++++++ include/register.inc.php | 236 +++++++++++++++++++++ templates/docs/contacts.tpl | 2 +- templates/index.tpl | 2 +- templates/inscription/error.tpl | 25 --- templates/inscription/step1a.tpl | 39 ---- templates/inscription/step2.tpl | 163 -------------- templates/mails/inscrire.mail.tpl | 4 +- templates/mails/marketing.relance.tpl | 2 +- templates/mails/marketing.utilisateur.tpl | 2 +- templates/password_prompt.tpl | 4 +- .../{inscription/index.tpl => register/step0.tpl} | 30 ++- .../{inscription/maj.tpl => register/step1.tpl} | 33 ++- .../{inscription/step1.tpl => register/step2.tpl} | 41 ++-- templates/register/step3.tpl | 88 ++++++++ .../{inscription/step3.tpl => register/step4.tpl} | 15 +- upgrade/0.9.4/20_register.sql | 23 ++ 23 files changed, 525 insertions(+), 533 deletions(-) delete mode 100644 htdocs/inscription/index.php delete mode 100644 htdocs/inscription/maj.php delete mode 100644 htdocs/inscription/step1.php delete mode 100644 htdocs/inscription/step2.php delete mode 100644 htdocs/inscription/step3.php create mode 100644 htdocs/register/index.php create mode 100644 include/register.inc.php delete mode 100644 templates/inscription/error.tpl delete mode 100644 templates/inscription/step1a.tpl delete mode 100644 templates/inscription/step2.tpl rename templates/{inscription/index.tpl => register/step0.tpl} (79%) rename templates/{inscription/maj.tpl => register/step1.tpl} (74%) rename templates/{inscription/step1.tpl => register/step2.tpl} (76%) create mode 100644 templates/register/step3.tpl rename templates/{inscription/step3.tpl => register/step4.tpl} (80%) create mode 100644 upgrade/0.9.4/20_register.sql diff --git a/hooks/tmp.inc.php b/hooks/tmp.inc.php index 8451ba7..5244f29 100644 --- a/hooks/tmp.inc.php +++ b/hooks/tmp.inc.php @@ -25,7 +25,7 @@ function tmp_menu() $globals->menu->addPrivateEntry(XOM_ADMIN, 20, 'Clear cache', 'clear_all_cache.php'); $globals->menu->addPublicEntry(XOM_US, 00, 'Me connecter !', 'login.php'); - $globals->menu->addPublicEntry(XOM_US, 10, 'M\'inscrire', 'inscription/'); + $globals->menu->addPublicEntry(XOM_US, 10, 'M\'inscrire', 'register/'); $globals->menu->addPublicEntry(XOM_US, 20, 'Pourquoi m\'inscrire ?', 'docs/services.php'); $globals->menu->addPublicEntry(XOM_EXT, 10, 'Associations X', 'http://www.polytechnique.net/'); diff --git a/htdocs/inscription/index.php b/htdocs/inscription/index.php deleted file mode 100644 index 70aa5e2..0000000 --- a/htdocs/inscription/index.php +++ /dev/null @@ -1,26 +0,0 @@ -run(); -?> diff --git a/htdocs/inscription/maj.php b/htdocs/inscription/maj.php deleted file mode 100644 index 805c186..0000000 --- a/htdocs/inscription/maj.php +++ /dev/null @@ -1,66 +0,0 @@ -xdb->query('SELECT * FROM envoidirect WHERE uid={?}', Env::get('n')); - if ($ligne = $res->fetchOneRow()) { - - if (!Env::has('charte')) { - new_skinned_page('inscription/step1a.tpl', AUTH_PUBLIC); - $page->run(); - } - - // il faut remettre le matricule dans son format de saisie - - $year = intval(substr($ligne['matricule'],0,4)); - $rang = intval(substr($ligne['matricule'],4,4)); - if($year<1996) { - $_REQUEST['matricule'] = ''; - } elseif($year<2000) { - $_REQUEST['matricule'] = sprintf('%02u0%03u',$year % 100,$rang); - } elseif($year<2100) { - $_REQUEST['matricule'] = sprintf('1%02u%03u',$year % 100,$rang); - } - $_REQUEST['promo'] = $ligne['promo']; - $_REQUEST['nom'] = $ligne['nom']; - $_REQUEST['prenom'] = $ligne['prenom']; - $_REQUEST['email'] = $ligne['email']; - - new_skinned_page('inscription/step2.tpl', AUTH_PUBLIC); - require_once("identification.inc.php"); - require_once("applis.func.inc.php"); - - $page->assign('homonyme', $homonyme); - $page->assign('forlife', $forlife); - $page->assign('mailorg', $mailorg); - $page->assign('prenom', $prenom); - $page->assign('nom', $nom); - - $page->assign('envoidirect', Env::get('n')); - $page->run(); - } -} - -new_skinned_page('inscription/maj.tpl', AUTH_PUBLIC); -$page->run(); -?> diff --git a/htdocs/inscription/step1.php b/htdocs/inscription/step1.php deleted file mode 100644 index 968ca76..0000000 --- a/htdocs/inscription/step1.php +++ /dev/null @@ -1,29 +0,0 @@ -run(); - -?> diff --git a/htdocs/inscription/step2.php b/htdocs/inscription/step2.php deleted file mode 100644 index dd76160..0000000 --- a/htdocs/inscription/step2.php +++ /dev/null @@ -1,36 +0,0 @@ -assign('homonyme', $homonyme); -$page->assign('forlife', $forlife); -$page->assign('mailorg', $mailorg); -$page->assign('prenom', $prenom); -$page->assign('nom', $nom); - -$page->run(); -?> diff --git a/htdocs/inscription/step3.php b/htdocs/inscription/step3.php deleted file mode 100644 index 02033a0..0000000 --- a/htdocs/inscription/step3.php +++ /dev/null @@ -1,88 +0,0 @@ -assign('forlife', $forlife); - -if (!isvalid_email(Env::get('email'))) { - $page->trig("Le champ 'E-mail' n'est pas valide."); -} - -if (!isvalid_email_redirection(Env::get('email'))) { - $page->trig("\"$forlife@polytechnique.org\" doit renvoyer vers un email existant valide. - En particulier, il ne peut pas être renvoyé vers lui-même."); -} - -if (!ereg("[0-3][0-9][0-1][0-9][1][9]([0-9]{2})", Env::get('naissance'))) { - $page->trig("La 'Date de naissance' n'est pas correcte. - Elle est obligatoire pour continuer mais ne sera jamais visible sur le site par la suite."); -} - -if($page->nb_errs()) { - $page->changeTpl('inscription/step2.tpl'); - require_once("applis.func.inc.php"); - $page->assign('homonyme', $homonyme); - $page->assign('mailorg', $mailorg); - - $page->assign('prenom', $prenom); - $page->assign('nom', $nom); - - $page->run(); -} - -$ins_id = rand_url_id(12); -$pass_clair = rand_pass(); -$password = md5($pass_clair); -$date = date("Y-m-j"); - -$birth = sprintf("%s-%s-%s", substr(Env::get('naissance'),4,4), - substr(Env::get('naissance'),2,2), substr(Env::get('naissance'),0,2)); - -// nouvelle inscription -$globals->xdb->execute( - "REPLACE INTO en_cours (ins_id, password, matricule, promo, nom, prenom, email, naissance, date, nationalite, - appli_id1, appli_type1, appli_id2, appli_type2, loginbis, username, homonyme) - VALUES ({?},{?},{?},{?},{?},{?},{?},{?},{?},{?},{?},{?},{?},{?},{?},{?},{?})" - $ins_id, $password, $matricule, $promo, $nom, $prenom, Env::get('email'), $birth, - $date, Env::get('nationalite'), Env::get('appli_id1'), Env::get('appli_type1'), - Env::get('appli_id2'), Env::get('appli_type2'), $mailorg, $forlife, $homonyme -); -$globals->xdb->execute('UPDATE auth_user_md5 SET last_known_email={?} WHERE matricule = {?}', Env::get('email'), $matricule); -// si on venait de la page maj.php, on met a jour la table envoidirect -if (Env::get('envoidirect')) { - $globals->xdb->execute('UPDATE envoidirect SET date_succes=NOW() WHERE uid={?}', Env::get('envoidirect')); -} - -require_once('xorg.mailer.inc.php'); -$mymail = new XOrgMailer('inscrire.mail.tpl'); -$mymail->assign('mailorg', $mailorg); -$mymail->assign('lemail', Env::get('email')); -$mymail->assign('pass_clair', $pass_clair); -$mymail->assign('baseurl', $globals->baseurl); -$mymail->assign('ins_id', $ins_id); -$mymail->assign('subj', $mailorg."@polytechnique.org"); -$mymail->send(); - -$page->run(); -?> diff --git a/htdocs/register/index.php b/htdocs/register/index.php new file mode 100644 index 0000000..a97be21 --- /dev/null +++ b/htdocs/register/index.php @@ -0,0 +1,102 @@ + date('Y')) { + $err = "La promotion saisie est incorrecte !"; + } else { + $sub_state['step'] = 2; + $sub_state['promo'] = $promo; + if ($promo >= 1996 && $promo<2000) { + $sub_state['mat'] = ($promo % 100)*10 . '???'; + } elseif($promo >= 2000) { + $sub_state['mat'] = 100 + ($promo % 100) . '???'; + } + } + } + break; + + case 2: + if (count($_POST)) { + require_once('register.inc.php'); + $sub_state['prenom'] = Post::get('prenom'); + $sub_state['nom'] = Post::get('nom'); + $sub_state['mat'] = Post::get('mat'); + $err = check_new_user($sub_state); + + if ($err !== true) { break; } + $err = create_aliases($sub_state); + if ($err === true) { + unset($err); + $sub_state['step'] = 3; + } + } + break; + + case 3: + if (count($_POST)) { + require_once('register.inc.php'); + if (!isvalid_email(Post::get('email'))) { + $err[] = "Le champ 'E-mail' n'est pas valide."; + } elseif (!isvalid_email_redirection(Post::get('email'))) { + $err[] = $sub_state['forlife']." doit renvoyer vers un email existant ". + "valide, en particulier, il ne peut pas être renvoyé vers lui-même."; + } + if (!preg_match('/^[0-3][0-9][01][0-9][12][90][0-9][0-9]$/', Post::get('naissance'))) { + $err[] = "La 'Date de naissance' n'est pas correcte."; + } + + 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; + $sub_state['email'] = Post::get('email'); + $sub_state['naissance'] = $birth; + finish_ins($sub_state); + } + } + break; +} + +$_SESSION['sub_state'] = $sub_state; +new_skinned_page('register/step'.intval($sub_state['step']).'.tpl', AUTH_PUBLIC); +if (isset($err)) { $page->trig($err); } +$page->run(); +?> diff --git a/include/register.inc.php b/include/register.inc.php new file mode 100644 index 0000000..3b7bcd3 --- /dev/null +++ b/include/register.inc.php @@ -0,0 +1,236 @@ + 2 || $maxlen == strlen($_nom)); +} + +// }}} +// {{{ function check_mat + +function check_mat($promo, $mat, $nom, $prenom, &$ourmat, &$ourid) +{ + global $globals; + if (!preg_match('/^[0-9][0-9][0-9][0-9][0-9][0-9]$/', $mat)) { + return "Le matricule doit comporter 6 chiffres."; + } + + $year = intval(substr($mat, 0, 3)); + $rang = intval(substr($mat, 3, 3)); + if ($year > 200) { $year /= 10; }; + if ($year < 96) { + return "ton matricule est incorrect"; + } else { + $ourmat = sprintf('%04u%04u', 1900+$year, $rang); + } + + $res = $globals->xdb->query( + 'SELECT user_id, promo, perms IN ("admin","user"), nom, prenom + FROM auth_user_md5 + WHERE matricule={?} and deces = 0', $ourmat); + list ($uid, $_promo, $_already, $_nom, $_prenom) = $res->fetchOneRow(); + if ($_already) { return "tu es déjà inscrit ou ton matricule est incorrect !"; } + if ($_promo != $promo) { return "erreur de matricule"; } + + if (!user_cmp($prenom, $nom, $_prenom, $_nom)) { + return "erreur dans l'identification. Réessaie, il y a une erreur quelque part !"; + } + + $ourid = $uid; + return true; +} + +// }}} +// {{{ function check_old_mat + +function check_old_mat($promo, $mat, $nom, $prenom, &$ourmat, &$ourid) +{ + global $globals; + + $res = $globals->xdb->iterRow( + 'SELECT user_id, nom, prenom, matricule + FROM auth_user_md5 + WHERE promo={?} AND deces=0 AND perms="pending"', $promo); + + while (list($_uid, $_nom, $_prenom, $_mat) = $res->next()) { + if (user_cmp($prenon, $nom, $_prenom, $_nom)) { + $ourid = $_uid; + $ourmat = $_mat; + return true; + } + } + + return "erreur dans l'identification. Réessaie, il y a une erreur quelque part !"; +} + +// }}} +// {{{ function check_new_user + +function check_new_user(&$sub) +{ + global $globals; + extract($sub); + + $prenom = preg_replace("/[ \t]+/", ' ', trim($prenom)); + $prenom = make_firstname_case($prenom); + + $nom = preg_replace("/[ \t]+/", ' ', trim($nom)); + $nom = strtoupper(replace_accent($nom)); + + if ($promo >= 1996) { + $res = check_mat($promo, $mat, $nom, $prenom, $ourmat, $ourid); + } else { + $res = check_old_mat($promo, $mat, $nom, $prenom, $ourmat, $ourid); + } + if ($res !== true) { return $res; } + + $sub['nom'] = $nom; + $sub['prenom'] = $prenom; + $sub['ourmat'] = $ourmat; + $sub['uid'] = $ourid; + + return true; +} + +// }}} +// {{{ function create_aliases + +function create_aliases (&$sub) +{ + global $globals; + extract ($sub); + + $mailorg = make_username($prenom, $nom); + $mailorg2 = sprintf("%02u", ($promo%100)); + $forlife = make_forlife($prenom, $nom, $promo); + /*****************************************************************************/ + /***************************** IDENTIFICATION OK *****************************/ + /*****************************************************************************/ + + $res = $globals->xdb->query('SELECT COUNT(*) FROM aliases WHERE alias={?}', $forlife); + if ($res->fetchOneCell() > 0) { + return "Tu as un homonyme dans ta promo, il faut traiter ce cas manuellement.
". + "envoie un mail à support@polytechnique.org en expliquant ta situation."; + } + + $res = $globals->xdb->query('SELECT id, type, expire FROM aliases WHERE alias={?}', $forlife); + + if ( $res->numRows() ) { + + list($h_id, $h_type, $expire) = $res->fetchOneRow(); + $res->free(); + + if ( $h_type != 'homonyme' and empty($expire) ) { + $globals->xdb->execute('UPDATE aliases SET expire=ADDDATE(NOW(),INTERVAL 1 MONTH) WHERE alias={?}', $mailorg); + $globals->xdb->execute('REPLACE INTO homonymes (homonyme_id,user_id) VALUES ({?},{?})', $h_id, $h_id); + $globals->xdb->execute('REPLACE INTO homonymes (homonyme_id,user_id) VALUES ({?},{?})', $h_id, $uid); + $res = $globals->xdb->query("SELECT alias FROM aliases WHERE id={?}", $h_id); + $als = $res->fetchColumn(); + + require_once('diogenes/diogenes.hermes.inc.php'); + $mailer = new HermesMailer(); + $mailer->setFrom('"Support Polytechnique.org" '); + $mailer->addTo("$mailorg@polytechnique.org"); + $mailer->setSubject("perte de ton alias $mailorg dans un mois !"); + $mailer->addCc('"Support Polytechnique.org" '); + $msg = + "Un homonyme s'est inscrit, nous ne pouvons donc garder ton alias '$mailorg'.\n\n". + "Tu gardes tout de même l'usage de cet alias pour un mois encore à compter de ce jour.\n\n". + "Lorsque cet alias sera désactivé, l'adresse :\n". + " $mailorg@polytechnique.org\n". + "renverra vers un robot qui indique qu'il y a plusieurs personnes portant le même nom ;\n". + "cela évite que l'un des homonymes reçoive des courriels destinés à l'autre.\n\n". + "Pour te connecter au site, tu pourras utiliser comme identifiant n'importe lequel de tes autres alias :\n". + " ".join(', ', $als)."\n"; + "Commence dès aujourd'hui à communiquer à tes correspondants la nouvelle adresse que tu comptes utiliser !\n\n". + "En nous excusant pour le désagrément occasionné,\n". + "cordialement,\n". + "-- \n". + "L'équipe de Polytechnique.org\n". + "\"Le portail des élèves & anciens élèves de l'X\""; + $mailer->SetTxtBody(wordwrap($msg,72)); + $mailer->send(); + } + + $sub['forlife'] = $forlife; + $sub['bestalias'] = $mailorg2; + $sub['mailorg2'] = null; + } else { + $sub['forlife'] = $forlife; + $sub['bestalias'] = $mailorg; + $sub['mailorg2'] = $mailorg2; + } + + return true; +} + +// }}} +// {{{ function finish_ins + +function finish_ins($sub_state) +{ + global $globals; + extract($sub_state); + + $pass = rand_pass(); + $pass_md5 = md5($pass_clair); + $hash = rand_url_id(12); + + $globals->xdb->execute('UPDATE auth_user_md5 SET last_known_email={?} WHERE matricule = {?}', $email, $mat); + + $globals->xdb->execute( + "REPLACE INTO register_pending (uid, forlife, bestalias, mailorg2, password, email, date, relance, naissance, hash) + VALUES ({?}, {?}, {?}, {?}, {?}, {?}, NOW(), 0, {?}, {?})", + $uid, $forlife, $bestalias, $mailorg2, $pass_md5, $email, $naissance, $hash); + + require_once('xorg.mailer.inc.php'); + $mymail = new XOrgMailer('inscrire.mail.tpl'); + $mymail->assign('mailorg', $bestalias); + $mymail->assign('lemail', $email); + $mymail->assign('pass', $pass); + $mymail->assign('baseurl', $globals->baseurl); + $mymail->assign('hash', $hash); + $mymail->assign('subj', $bestalias."@polytechnique.org"); + $mymail->send(); +} + +// }}} +?> diff --git a/templates/docs/contacts.tpl b/templates/docs/contacts.tpl index 7197591..9f53e74 100644 --- a/templates/docs/contacts.tpl +++ b/templates/docs/contacts.tpl @@ -71,7 +71,7 @@ Cel Je n'arrive pas à m'inscrire sur le site

-L'inscription se déroule en une étape sur notre site web, +L'inscription se déroule en une étape sur notre site web, suivie d'une étape de confirmation basée sur l'e-mail que tu as donné.

diff --git a/templates/index.tpl b/templates/index.tpl index 3b12f7c..dd0a975 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -36,7 +36,7 @@ Si vous êtes polytechnicien,

Vous pouvez consulter la liste de ce que vous apporte Polytechnique.org si vous hésitez à vous inscrire ! diff --git a/templates/inscription/error.tpl b/templates/inscription/error.tpl deleted file mode 100644 index cf98809..0000000 --- a/templates/inscription/error.tpl +++ /dev/null @@ -1,25 +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 * - ***************************************************************************} - - -{$html|smarty:nodefaults} - - -{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/inscription/step1a.tpl b/templates/inscription/step1a.tpl deleted file mode 100644 index 305afc2..0000000 --- a/templates/inscription/step1a.tpl +++ /dev/null @@ -1,39 +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 * - ***************************************************************************} - - -
-

- Conditions générales -

-

- L'enregistrement se déroule en deux étapes. La pré-inscription te prendra moins - de 5 minutes. La seconde étape est une phase de validation où c'est nous qui te - recontactons pour te fournir un mot de passe et te demander de le changer. -

- {include file="docs/charte.tpl"} -
- - -
-
- - -{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/inscription/step2.tpl b/templates/inscription/step2.tpl deleted file mode 100644 index 132a822..0000000 --- a/templates/inscription/step2.tpl +++ /dev/null @@ -1,163 +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 * - ***************************************************************************} - - -{include file="applis.js.tpl"} - -

- Formulaire de pré-inscription -

- - -
- {if $homonyme} -

- Tu as déjà un homonyme inscrit dans notre base de données mais dans une autre promotion, nous allons - donc te donner l'adresse {$mailorg}@polytechnique.org, en plus - de ton adresse à vie {$forlife}@polytechnique.org. -

- {else} -

- Tu n'as pour le moment aucun homonyme dans notre base de données, nous allons - donc te donner l'adresse {$mailorg}@polytechnique.org, en plus - de ton adresse à vie {$forlife}@polytechnique.org. - Sache que tu peux perdre l'adresse {$mailorg}@polytechnique.org - si un homonyme s'inscrit (même si cela reste assez rare). -

- {/if} - -

- Elle pointera sur les e-mails de ton choix, indique-s-en un pour commencer - (tu pourras indiquer les autres une fois l'inscription terminée). - Attention, il doit impérativement être correct pour que nous puissions - t'envoyer ton mot de passe. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Contact et sécurité -
- E-mail
- (Première redirection) -
- -
- Date de naissance
- (Format JJMMAAAA) -
- - (demandée si perte de mot de passe) -
- Fiche personnelle -
- Identité - - {$prenom} {$nom}, X{$smarty.request.promo} -
- Nom de mariage - - Si ton nom de mariage est différent de {$nom}, tu pourras le préciser dans - ton profil une fois que tu auras confirmé ton inscription. -
- Nationalité - - -
- Appli graduate - - -
- - -
- Post-graduate - - -
- - -
- - - - - - -
-
- - -{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/mails/inscrire.mail.tpl b/templates/mails/inscrire.mail.tpl index 22c0415..3c06390 100644 --- a/templates/mails/inscrire.mail.tpl +++ b/templates/mails/inscrire.mail.tpl @@ -29,11 +29,11 @@ Ton inscription sur Polytechnique.org est presque termin Après activation, tes paramètres seront : login : {$mailorg} -mot de passe : {$pass_clair} +mot de passe : {$pass} Rends-toi sur la page web suivante afin d'activer ta pré-inscription, et de changer ton mot de passe en quelque chose de plus facile à mémoriser : -{$baseurl}/inscription/step4.php?ref={$ins_id} +{$baseurl}/register/end.php?hash={$hash} Si en cliquant dessus tu n'y arrives pas, copie intégralement l'adresse dans la barre de ton navigateur. diff --git a/templates/mails/marketing.relance.tpl b/templates/mails/marketing.relance.tpl index a3f6ac3..ac23336 100644 --- a/templates/mails/marketing.relance.tpl +++ b/templates/mails/marketing.relance.tpl @@ -37,7 +37,7 @@ mot de passe : {$nveau_pass} Rends-toi sur la page web suivante afin d'activer ta pré-inscription, et de changer ton mot de passe en quelque chose de plus facile à mémoriser : -{$baseurl}/inscription/step4.php?ref={$lins_id} +{$baseurl}/register/end.php?hash={$lins_id} Si en cliquant dessus tu n'y arrives pas, copie intégralement l'adresse dans la barre de ton navigateur. diff --git a/templates/mails/marketing.utilisateur.tpl b/templates/mails/marketing.utilisateur.tpl index 92f347b..00e767a 100644 --- a/templates/mails/marketing.utilisateur.tpl +++ b/templates/mails/marketing.utilisateur.tpl @@ -30,7 +30,7 @@ Cher camarade, Ta fiche n'est pas à jour dans l'annuaire des Polytechniciens sur Internet. Pour la mettre à jour, il te suffit de visiter cette page ou de copier cette adresse dans la barre de ton navigateur : ========================================================== -{$baseurl}/inscription/maj.php?n={$user_id} +{$baseurl}/register/maj.php?n={$user_id} ========================================================== Il ne te faut que 5 minutes sur http://www.polytechnique.org/ pour rejoindre les {$num_users} camarades branchés grâce au système de reroutage de l'X et qui permet de joindre un camarade en connaissant seulement son nom et son prénom... et de bénéficier pour la vie d'une adresse prestigieuse {$mailorg}@polytechnique.org et son alias discret {$mailorg}@m4x.org (m4x = mail for X). diff --git a/templates/password_prompt.tpl b/templates/password_prompt.tpl index e7ab668..8d06f56 100644 --- a/templates/password_prompt.tpl +++ b/templates/password_prompt.tpl @@ -35,7 +35,7 @@

Merci de rentrer ton mot de passe pour démarrer une connexion au site. Si tu n'es pas {insert name="getName"}, change le login ci-dessous, ou rends-toi sur -la page d'inscription. +la page d'inscription.

{/min_auth} @@ -52,7 +52,7 @@ Si tu n'es pas {insert name="getName"}, change le login ci-dessous, ou rends-toi Si tu n'es jamais venu sur le site, il faut t'enregistrer auprès de nous pour obtenir un accès. Polytechnique.org c'est l'e-mail des X, l'annuaire en ligne, plus un tas d'autres services. Nous te fournirons un accès le plus - rapidement possible. Clique ici pour nous demander tes + rapidement possible. Clique ici pour nous demander tes paramètres personnels. diff --git a/templates/inscription/index.tpl b/templates/register/step0.tpl similarity index 79% rename from templates/inscription/index.tpl rename to templates/register/step0.tpl index 58c57ca..891a08a 100644 --- a/templates/inscription/index.tpl +++ b/templates/register/step0.tpl @@ -19,18 +19,26 @@ ***************************************************************************} -
-

- Conditions générales -

-

- L'enregistrement se déroule en deux étapes. La pré-inscription te prendra moins - de 5 minutes. La seconde étape est une phase de validation où c'est nous qui te - recontactons pour te fournir un mot de passe et te demander de le changer. -

- {include file="docs/charte.tpl"} +

Conditions générales

+ +

+L'enregistrement se déroule en deux étapes : +

+
    +
  • + la pré-inscription quit te prendra moins de 5 minutes ; +
  • +
  • + suivi d'un envoi d'un mail de notre part (immédiat !) qui te permettra + de te connecter au site ! +
  • +
+ +{include file="docs/charte.tpl"} + +
- +
diff --git a/templates/inscription/maj.tpl b/templates/register/step1.tpl similarity index 74% rename from templates/inscription/maj.tpl rename to templates/register/step1.tpl index 3a6fd5c..c7fe719 100644 --- a/templates/inscription/maj.tpl +++ b/templates/register/step1.tpl @@ -18,15 +18,30 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************} +

Identification

-

-Cette page n'existe pas ou plus. Tu as peut-être déjà cliqué une fois, l'adresse -envoyée par e-mail n'est valable qu'une seule fois. Le plus simple est d'aller à -la page d'enregistrement en cliquant sur ce lien. -

-

-A la fin de l'enregistrement, tu obtiendras login et mot de passe pour -modifier ta fiche dans l'annuaire on-line. -

+
+

+ Avant toute chose, il te faut nous donner ta promotion : +

+ + + + + + + + + + +
+ Promotion +
+ Donne ta promotion sur 4 chiffres : + +
+ +
+
{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/inscription/step1.tpl b/templates/register/step2.tpl similarity index 76% rename from templates/inscription/step1.tpl rename to templates/register/step2.tpl index 99d460b..2c8a46f 100644 --- a/templates/inscription/step1.tpl +++ b/templates/register/step2.tpl @@ -18,40 +18,37 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************} +

Identification

-
-

- Identification -

-

- Renseigne tes nom, prénom et promotion, et si tu es d'une promotion - postérieure à la 1996, ton numéro de matricule. -

+

+retour +

+ + + {if $smarty.session.sub_state.promo >= 1996} - - + + + + + + {/if} diff --git a/templates/register/step3.tpl b/templates/register/step3.tpl new file mode 100644 index 0000000..d4e2099 --- /dev/null +++ b/templates/register/step3.tpl @@ -0,0 +1,88 @@ +{*************************************************************************** + * 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 * + ***************************************************************************} + + +{if $smarty.session.sub_state.forlife} + +

Formulaire de pré-inscription

+ + + {if $smarty.session.sub_state.mailorg2} +

+ Tu n'as pour le moment aucun homonyme dans notre base de données, nous allons + donc te donner l'adresse {$smarty.session.sub_state.bestalias}@polytechnique.org, + en plus de ton adresse à vie {$smarty.session.sub_state.forlife}@polytechnique.org. + Sache que tu peux perdre l'adresse {$smarty.session.sub_state.bestalias}@polytechnique.org + si un homonyme s'inscrit (même si cela reste assez rare). +

+ {else} +

+ Tu as déjà un homonyme inscrit dans notre base de données mais dans une autre promotion, nous allons + donc te donner l'adresse {$smarty.session.sub_state.bestalias}@polytechnique.org, en plus + de ton adresse à vie {$smarty.session.sub_state.forlife}@polytechnique.org. +

+ {/if} + +

+ Ces adresses sont des redirections vers des adresses e-mail de ton choix. + Indique-s-en un pour commencer (tu pourras indiquer les autres une fois l'inscription terminée) et pouvoir + terminer ton inscription. +

+

+ Attention, il doit impérativement être correct pour que nous puissions + t'envoyer ton mot de passe. +

+ +
- Promo < 1996 - - Promo depuis 1996 - matricule
+ Matricule X : + - Le numéro d'identification n'est pas nécessaire pour - l'inscription pour les promotions jusqu'à 1995 incluse. +
- Matricule X :   - -
- 6 chiffres terminant par le numéro d'entrée
- (ex: 960532 ou 100532)
+ 6 chiffres terminant par le numéro d'entrée (ex: 960532 ou 101532)
Voir sur le GU ou un bulletin de solde pour trouver cette information

Pour les élèves étrangers voie 2, il est du type :
Promotion: 1995, Matricule: 960XXX - Promotion: 2001, Matricule 102XXX.
Identification @@ -79,7 +76,7 @@ Promotion - +
+ + + + + + + + + + + + + + +
+ Contact et sécurité +
+ E-mail
+ (Première redirection) +
+ +
+ Date de naissance
+ (Format JJMMAAAA) +
+ + (demandée si perte de mot de passe) +
+ +
+
+ +{/if} + +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/inscription/step3.tpl b/templates/register/step4.tpl similarity index 80% rename from templates/inscription/step3.tpl rename to templates/register/step4.tpl index 3fd8d87..dbac7ae 100644 --- a/templates/inscription/step3.tpl +++ b/templates/register/step4.tpl @@ -19,27 +19,22 @@ ***************************************************************************} -

- Pré-inscription réussie -

+

Pré-inscription réussie

La pré-inscription que tu viens de soumettre a été enregistrée.

Les instructions te permettant notamment d'activer ton e-mail -{$forlife}@polytechnique.org, ainsi que ton mot de passe pour -accéder au site viennent de t'être envoyés à l'adresse -{$smarty.request.email}. +{$smarty.session.sub_state.forlife}@polytechnique.org, ainsi que ton mot de passe pour +accéder au site viennent de t'être envoyés à l'adresse {$smarty.session.sub_state.email}.

Tu n'as que quelques jours pour suivre ces instructions après quoi la pré-inscription -est effacée automatiquement de nos bases et il faut tout recommencer. Si tu as soumis -plusieurs pré-inscriptions, seul le dernier e-mail reçu est valable, les précédents -ne servant plus. +est effacée automatiquement de nos bases et il faut tout recommencer.

-Si tu ne reçois rien, vérifie bien l'adresse {$smarty.request.email}. +Si tu ne reçois rien, vérifie bien l'adresse {$smarty.session.sub_state.email}.

{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/upgrade/0.9.4/20_register.sql b/upgrade/0.9.4/20_register.sql new file mode 100644 index 0000000..0fbc85d --- /dev/null +++ b/upgrade/0.9.4/20_register.sql @@ -0,0 +1,23 @@ +-- MySQL dump 9.11 + +-- +-- Table structure for table register_pending +-- + +CREATE TABLE register_pending ( + uid varchar(32) NOT NULL default '', + forlife varchar(255) NOT NULL default '', + bestalias varchar(255) NOT NULL default '', + mailorg2 varchar(255) default null, + password varchar(32) NOT NULL default '', + email varchar(255) NOT NULL default '', + date date NOT NULL default '0000-00-00', + relance date NOT NULL default '0000-00-00', + naissance date NOT NULL default '0000-00-00', + hash varchar(12) NOT NULL default '', + PRIMARY KEY (uid), + UNIQUE KEY (forlife), + UNIQUE KEY (bestalias), + INDEX (hash) +); + -- 2.1.4