<?php
/***************************************************************************
- * Copyright (C) 2003-2011 Polytechnique.org *
+ * Copyright (C) 2003-2014 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
// Register the optional services requested by the user.
$services = array();
- foreach (array('ax_letter', 'imap', 'ml_promo', 'nl') as $service) {
+ foreach (array('com_letters', 'imap', 'ml_promo', 'nl') as $service) {
if (Post::b($service)) {
$services[] = $service;
}
}
XDB::commit();
+ // 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_PASSWD);
+
// Add the registration email address as first and only redirection.
require_once 'emails.inc.php';
$user = User::getSilentWithUID($uid);
update_alias_user($old_account_email, $user->forlifeEmail());
}
- // 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_PASSWD);
-
// Subscribe the user to the services she did request at registration time.
require_once 'newsletter.inc.php';
foreach (explode(',', $services) as $service) {
switch ($service) {
- case 'ax_letter':
+ case 'ax_letter': /* This option is deprecated by 'com_letters' */
NewsLetter::forGroup(NewsLetter::GROUP_AX)->subscribe($user);
break;
+ case 'com_letters':
+ NewsLetter::forGroup(NewsLetter::GROUP_AX)->subscribe($user);
+ NewsLetter::forGroup(NewsLetter::GROUP_EP)->subscribe($user);
+ NewsLetter::forGroup(NewsLetter::GROUP_FX)->subscribe($user);
+ break;
case 'nl':
NewsLetter::forGroup(NewsLetter::GROUP_XORG)->subscribe($user);
break;
VALUES ({?}, {?})',
$uid, $asso_id);
try {
- $mmlist = new MMList($user);
- $mmlist->subscribe("promo" . $yearpromo);
+ MailingList::subscribePromo($yearpromo, $user);
} catch (Exception $e) {
PlErrorReport::report($e);
$page->trigError("L'inscription à la liste promo" . $yearpromo . " a échouée.");
// Notify other users which were watching for her arrival.
XDB::execute('INSERT INTO contacts (uid, contact)
- SELECT uid, ni_id
+ SELECT uid, {?}
FROM watch_nonins
- WHERE ni_id = {?}', $uid);
+ WHERE ni_id = {?}', $pid, $uid);
XDB::execute('DELETE FROM watch_nonins
WHERE ni_id = {?}', $uid);
Platal::session()->updateNbNotifs();
}
}
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
?>