X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Femails.inc.php;h=a15bb3ae43a6045cd69be856021bfe827242b554;hb=4d2d6d18a318843e76a3a3ecb50446770ac9f788;hp=325c5abaef44afc4d3b6447ae27471a5e99e4b67;hpb=787bb3d745141f2f85bd947ad7dd775d2c63f908;p=platal.git diff --git a/include/emails.inc.php b/include/emails.inc.php index 325c5ab..a15bb3a 100644 --- a/include/emails.inc.php +++ b/include/emails.inc.php @@ -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,9 +375,9 @@ class Redirect public function get_broken_mx() { - $res = XDB::query("SELECT host, text - FROM mx_watch - WHERE state != 'ok'"); + $res = XDB::query("SELECT host, text, state + FROM mx_watch + WHERE state != 'ok'"); if (!$res->numRows()) { return array(); } @@ -388,15 +391,18 @@ 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; } } }