From: Florent Bruneau
Date: Tue, 16 Oct 2007 19:30:51 +0000 (+0200)
Subject: Revert "Don't show warning mx on the front page if the user has another valid"
X-Git-Tag: xorg/0.9.15~30
X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=3083bd93007e9be01f0536bcb7047989c2bd153e;p=platal.git
Revert "Don't show warning mx on the front page if the user has another valid"
This reverts commit 8f11b29f7600dfcc825065ce9e89e3c7866de5c6.
---
diff --git a/include/emails.inc.php b/include/emails.inc.php
index a8eef27..2597086 100644
--- a/include/emails.inc.php
+++ b/include/emails.inc.php
@@ -372,7 +372,7 @@ class Redirect
public function get_broken_mx()
{
- $res = XDB::query("SELECT host, text, state
+ $res = XDB::query("SELECT host, text
FROM mx_watch
WHERE state != 'ok'");
if (!$res->numRows()) {
@@ -388,17 +388,15 @@ 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, 'state' => $state);
+ $mails[] = array('mail' => $mail->email, 'text' => $broken);
break;
}
}
diff --git a/include/xorg.misc.inc.php b/include/xorg.misc.inc.php
index 2ecaab8..96db292 100644
--- a/include/xorg.misc.inc.php
+++ b/include/xorg.misc.inc.php
@@ -287,20 +287,6 @@ function check_redirect($red = null)
}
$_SESSION['no_redirect'] = !$red->other_active('');
$_SESSION['mx_failures'] = $red->get_broken_mx();
- $warning = 0;
- foreach ($red->emails as &$mail) {
- if ($mail->active) {
- $warning++;
- }
- }
- foreach ($_SESSION['mx_failures'] as &$fail) {
- if ($fail['state'] == 'broken') {
- $warning -= 99999;
- } else if ($fail['state'] == 'warning') {
- $warning--;
- }
- }
- $_SESSION['email_is_warning'] = ($warning <= 0 ? true : false);
}
function send_warning_mail($title)
diff --git a/templates/events/index.tpl b/templates/events/index.tpl
index 37d844e..72424d3 100644
--- a/templates/events/index.tpl
+++ b/templates/events/index.tpl
@@ -49,7 +49,7 @@ Bienvenue {$smarty.session.prenom}{if $birthday}
{/if}
-{if $smarty.session.email_is_warning}
+{if $smarty.session.mx_failures|@count}