- #891: Improves education display -JAC
================================================================================
-VERSION 0.10.1 XX XX XXXX
+VERSION 0.10.2 XX XX XXXX
+
+New:
+
+================================================================================
+VERSION 0.10.1 30 07 2009
New:
* Core:
- #680: Retrieve dead redirections thanks to inactive redirections -JAC
+ - #862: Remodels the registration process -VZA
* Mail:
- Notifies the sender when a moderated message to a ML is accepted -JAC
// Additional fields (non core)
protected $promo = null;
+ public function promo()
+ {
+ return $this->promo;
+ }
+
// Implementation of the login to uid method.
protected function getLogin($login)
{
-Subproject commit 6c36b907ae72344efb81730e3b41a0ddc9473cec
+Subproject commit 9f671b1782f8abbdf718b3cedb90f2b7ee81550d
function run_banana(&$page, $class, array $args)
{
- $banana = new $class(S::user(), $args);
+ $user = S::user();
+ $banana = new $class($user, $args);
$page->assign('banana', $banana->run());
$page->addCssInline($banana->css());
$page->addCssLink('banana.css');
}
}
+ // Register the optional services requested by the user.
+ $services = array();
+ foreach (array('ax_letter', 'imap', 'ml_promo', 'nl') as $service) {
+ if (Post::b($service)) {
+ $services[] = $service;
+ }
+ }
+ $sub_state['services'] = $services;
+
// Validate the password.
if (!Post::v('response2', false)) {
$err[] = "Le mot de passe n'est pas valide.";
if ($hash) {
$res = XDB::query(
"SELECT r.uid, r.forlife, r.bestalias, r.mailorg2,
- r.password, r.email, r.naissance, u.nom, u.prenom,
+ r.password, r.email, r.services, r.naissance, u.nom, u.prenom,
u.promo, FIND_IN_SET('femme', u.flags), u.naissance_ini
FROM register_pending AS r
INNER JOIN auth_user_md5 AS u ON r.uid = u.user_id
</ol>");
}
- list($uid, $forlife, $bestalias, $mailorg2, $password, $email,
+ list($uid, $forlife, $bestalias, $mailorg2, $password, $email, $services,
$naissance, $nom, $prenom, $promo, $femme, $naiss_ini) = $res->fetchOneRow();
// Prepare the template for display.
$redirect = new Redirect($user);
$redirect->add_email($email);
+ // Try to start a session (so the user don't have to log in); we will use
+ // the password available in Post:: to authenticate the user.
+ Platal::session()->start(AUTH_MDP);
+
+ // Subscribe the user to the services she did request at registration time.
+ foreach (explode(',', $services) as $service) {
+ switch ($service) {
+ case 'ax_letter':
+ Platal::load('axletter', 'axletter.inc.php');
+ AXLetter::subscribe();
+ break;
+ case 'imap':
+ require_once 'emails.inc.php';
+ $user = S::user();
+ $storage = new EmailStorage($user, 'imap');
+ $storage->activate();
+ break;
+ case 'ml_promo':
+ $r = XDB::query('SELECT id FROM groupex.asso WHERE diminutif = {?}', S::user()->promo());
+ if ($r->numRows()) {
+ $asso_id = $r->fetchOneCell();
+ XDB::execute('REPLACE INTO groupex.membres (uid, asso_id)
+ VALUES ({?}, {?})',
+ S::user()->id(), $asso_id);
+ $mmlist = new MMList(S::user()->id(), S::v('password'));
+ $mmlist->subscribe("promo" . S::v('promo'));
+ }
+ break;
+ case 'nl':
+ require_once 'newsletter.inc.php';
+ NewsLetter::subscribe();
+ break;
+ }
+ }
+
// Log the registration in the user session.
S::logger($uid)->log('inscription', $email);
XDB::execute("UPDATE register_pending
// Update the global registration count stats.
$globals->updateNbIns();
- // Try to start a session (so the user don't have to log in); we will use
- // the password available in Post:: to authenticate the user.
- Platal::session()->start(AUTH_MDP);
-
//
// Update collateral data sources, and inform watchers by email.
//
SET last_known_email = {?}
WHERE matricule = {?}", $email, $mat);
XDB::execute(
- "REPLACE INTO register_pending (uid, forlife, bestalias, mailorg2, password, email, date, relance, naissance, hash)
- VALUES ({?}, {?}, {?}, {?}, {?}, {?}, NOW(), 0, {?}, {?})",
- $uid, $forlife, $bestalias, $mailorg2, $password, $email, $naissance, $hash);
+ "REPLACE INTO register_pending (uid, forlife, bestalias, mailorg2, password, email, date, relance, naissance, hash, services)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?}, NOW(), 0, {?}, {?}, {?})",
+ $uid, $forlife, $bestalias, $mailorg2, $password, $email, $naissance, $hash, implode(',', $services));
$mymail = new PlMailer('register/inscrire.mail.tpl');
$mymail->assign('mailorg', $bestalias);
<input type="hidden" name="action" value="ajouter" />
<input type="text" size="30" name="user" class="quick_search"
value="ajouter prenom.nom"
- onfocus="if (this.value == 'ajouter prenom.nom') this.value=''"
+ onfocus="if (this.value == 'ajouter prenom.nom') this.value=''; $('#add_button').show()"
onblur="if (this.value == '') this.value='ajouter prenom.nom'"
size="20" maxlength="70"/>
- <a href="" onclick="document.getElementById('add_user').submit(); return false;">
+ <a id="add_button" href="" style="display: none" onclick="document.getElementById('add_user').submit(); return false;">
{icon name=add title="Ajouter la personne"}
</a>
</div>
{checkpasswd prompt="password" text="Terminer la pré-inscription"}
</td>
</tr>
+ </table>
+ <table class="bicol">
<tr>
- <td colspan="2" class="center">
+ <th>Services supplémentaires</th>
+ </tr>
+ <tr class="impair">
+ <td>Pour profiter pleinement de ta nouvelle inscription, nous te proposons :</td>
+ </tr>
+ <tr class="pair">
+ <td>
+ <dl>
+ <dt><label><input type="checkbox" checked="checked" name="nl" /> lettre mensuelle</label></dt>
+ <dd>
+ de recevoir chaque mois la lettre mensuelle de Polytechnique.org contenant les activités et nouvelles de la communauté des X.
+ </dd>
+ <dt><label><input type="checkbox" checked="checked" name="ax_letter" /> envois de l'AX</label></dt>
+ <dd>
+ de recevoir les informations importantes de l'AX.
+ </dd>
+ <dt><label><input type="checkbox" checked="checked" name="ml_promo" /> ta promotion</label></dt>
+ <dd>
+ de recevoir les informations plus spécifiques de ta promotion pour pouvoir participer plus facilement aux événements
+ qu'elle organise. Nous t'inscrivons donc dans le groupe de la promotion {$smarty.session.sub_state.promo}.
+ </dd>
+ <dt><label><input type="checkbox" checked="checked" name="imap" />sauvegardes d'emails</label></dt>
+ <dd>
+ d'avoir un accès de secours aux 30 derniers jours d'emails reçus sur ton adresse Polytechnique.org.
+ </dd>
+ </dl>
+ </td>
+ </tr>
+ <tr class="impair">
+ <td>Valider mon inscription :</td>
+ </tr>
+ <tr class="impair">
+ <td class="center">
<input type="submit" name="submitn" value="Continuer" onclick="EncryptedResponseInNestedForm(); return false;" />
</td>
</tr>
PRIMARY KEY(uid, type_id)
) CHARSET=utf8;
+ALTER TABLE register_pending ADD services SET('ax_letter', 'imap', 'ml_promo', 'nl') NOT NULL DEFAULT '' AFTER hash;
+
-- vim:set syntax=mysql: