Add banana in __autoload to be sure session data are correctly handled.
[platal.git] / include / emails.inc.php
index 2597086..a15bb3a 100644 (file)
@@ -332,6 +332,7 @@ class Redirect
     {
         foreach ($this->emails as &$mail) {
             if ($mail->email == $email) {
+                check_redirect($this);
                 return $mail->cleanErrors($this->uid);
             }
         }
@@ -351,6 +352,7 @@ class Redirect
                 $mail->active   = false;
             }
         }
+        check_redirect($this);
     }
 
     // function enable() {{{2
@@ -365,6 +367,7 @@ class Redirect
                 $mail->active   = true;
                 $mail->disabled = false;
             }
+            check_redirect($this);
         }
     }
 
@@ -372,7 +375,7 @@ class Redirect
 
     public function get_broken_mx()
     {
-        $res = XDB::query("SELECT  host, text
+        $res = XDB::query("SELECT  host, text, state
                              FROM  mx_watch
                             WHERE  state != 'ok'");
         if (!$res->numRows()) {
@@ -388,15 +391,17 @@ class Redirect
                     $lcl_mxs = array($domain);
                 }
                 $broken = false;
+                $state  = false;
                 foreach ($mxs as &$mx) {
                     foreach ($lcl_mxs as $lcl) {
                         if (fnmatch($mx['host'], $lcl)) {
                             $broken = $mx['text'];
+                            $state  = $mx['state'];
                             break;
                         }
                     }
                     if ($broken) {
-                        $mails[] = array('mail' => $mail->email, 'text' => $broken);
+                        $mails[] = array('mail' => $mail->email, 'text' => $broken, 'state' => $state);
                         break;
                     }
                 }