Fixes reactivation of broken and suspended emails (Closes #1597).
authorStéphane Jacob <sj@m4x.org>
Mon, 9 Apr 2012 16:00:12 +0000 (18:00 +0200)
committerStéphane Jacob <sj@m4x.org>
Mon, 9 Apr 2012 16:00:12 +0000 (18:00 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
ChangeLog
include/emails.inc.php

index c31fb50..76c6dbe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@ Bug/Wish:
         - #1608: Displays proper url in auth-group-x login                 -JAC
 
     * Email:
+        - #1597: Fixes reactivation of broken and suspended emails         -JAC
         - #1601: Displays errors and warnings when adding people to ML     -JAC
 
     * Search:
index 4da4657..505f290 100644 (file)
@@ -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;
         }