X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Femails.inc.php;h=505f290728bae8f2c3181cc76d27b261d81b47ba;hb=abc8b908704ff4cf1afe51aef381557f678f7982;hp=2cf14d8c16ddb6256decbf34ab9aab5eb3373bfe;hpb=e93255ef54304c697ef7ac101247f23dc5f7b31f;p=platal.git diff --git a/include/emails.inc.php b/include/emails.inc.php index 2cf14d8..505f290 100644 --- a/include/emails.inc.php +++ b/include/emails.inc.php @@ -541,7 +541,7 @@ class Email // Activates the email address as a redirection. public function activate() { - if ($this->inactive) { + if (!$this->active) { if (in_array($this->type, self::get_allowed_storages($this->user))) { self::activate_storage($this->user, $this->type, $this->action); } else { @@ -551,6 +551,8 @@ class Email $this->user->id(), $this->email); } S::logger()->log('email_on', $this->email . ($this->user->id() != S::v('uid') ? "(admin on {$this->user->login()})" : '')); + $this->disabled = false; + $this->broken = false; $this->inactive = false; $this->active = true; } @@ -816,9 +818,10 @@ class Redirect XDB::execute('REPLACE INTO email_redirect_account (uid, redirect, flags, action) VALUES ({?}, {?}, \'active\', {?})', $this->user->id(), $email, $filter); + // Replace this email by forlife email, if present in aliases and MLs. $listClient = new MMList(S::user()); - $listClient->change_user_email($this->user->forlifeEmail(), $new_email); - update_alias_user($this->user->forlifeEmail(), $new_email); + $listClient->change_user_email($email, $this->user->forlifeEmail()); + update_alias_user($email, $this->user->forlifeEmail()); if ($logger = S::v('log', null)) { // may be absent --> step4.php S::logger()->log('email_add', $email . ($this->user->id() != S::v('uid') ? " (admin on {$this->user->login()})" : "")); }