From 561818ebeb14788a6af2f88f320b6e17b08ff373 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 12 Dec 2011 10:18:38 +0100 Subject: [PATCH] Removing that was stupid. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/register.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/register.php b/modules/register.php index f53e71b..27478a1 100644 --- a/modules/register.php +++ b/modules/register.php @@ -307,7 +307,7 @@ class RegisterModule extends PLModule $res = XDB::query("SELECT r.uid, p.pid, r.forlife, r.bestalias, r.mailorg2, r.password, r.email, r.services, r.naissance, ppn.lastname_initial, ppn.firstname_initial, pe.promo_year, - pd.promo, p.sex, p.birthdate_ref, a.type + pd.promo, p.sex, p.birthdate_ref, a.type, a.email AS old_account_email FROM register_pending AS r INNER JOIN accounts AS a ON (r.uid = a.uid) INNER JOIN account_profiles AS ap ON (a.uid = ap.uid AND FIND_IN_SET('owner', ap.perms)) @@ -333,7 +333,7 @@ class RegisterModule extends PLModule } list($uid, $pid, $forlife, $bestalias, $emailXorg2, $password, $email, $services, - $birthdate, $lastname, $firstname, $yearpromo, $promo, $sex, $birthdate_ref, $type) = $res->fetchOneRow(); + $birthdate, $lastname, $firstname, $yearpromo, $promo, $sex, $birthdate_ref, $type, $old_account_email) = $res->fetchOneRow(); $isX = ($type == 'x'); $mail_domain = User::$sub_mail_domains[$type] . $globals->mail->domain; @@ -396,6 +396,14 @@ class RegisterModule extends PLModule $redirect->add_email($email); fix_bestalias($user); + // If the user was registered to some aliases and MLs, we must change + // the subscription to her forlife email. + if ($old_account_email) { + $listClient = new MMList($user); + $listClient->change_user_email($old_account_email, $user->forlifeEmail()); + update_alias_user($old_account_email, $user->forlifeEmail()); + } + // Subscribe the user to the services she did request at registration time. require_once 'newsletter.inc.php'; foreach (explode(',', $services) as $service) { -- 2.1.4