Improves and fixes the admin interface for broken addresses.
authorStéphane Jacob <sj@m4x.org>
Sat, 28 Nov 2009 13:21:46 +0000 (14:21 +0100)
committerStéphane Jacob <sj@m4x.org>
Sat, 28 Nov 2009 13:21:46 +0000 (14:21 +0100)
modules/email.php

index 0898aa4..299e5c2 100644 (file)
@@ -834,17 +834,20 @@ L'équipe d'administration <support@" . $globals->mail->domain . '>';
                 $broken_list = explode("\n", $list);
                 sort($broken_list);
                 foreach ($broken_list as $orig_email) {
                 $broken_list = explode("\n", $list);
                 sort($broken_list);
                 foreach ($broken_list as $orig_email) {
-                    $email = valide_email(trim($orig_email));
-                    if (empty($email) || $email == '@') {
-                        $invalid_emails[] = trim($orig_email) . ': invalid email';
-                    } elseif (!in_array($email, $valid_emails)) {
-                        $res = XDB::query('SELECT  COUNT(*)
-                                             FROM  emails
-                                            WHERE  email = {?}', $email);
-                        if ($res->fetchOneCell() > 0) {
-                            $valid_emails[] = $email;
-                        } else {
-                            $invalid_emails[] = "$orig_email: no such redirection";
+                    $orig_email = trim($orig_email);
+                    if ($orig_email != '') {
+                        $email = valide_email($orig_email);
+                        if (empty($email) || $email == '@') {
+                            $invalid_emails[] = trim($orig_email) . ': invalid email';
+                        } elseif (!in_array($email, $valid_emails)) {
+                            $res = XDB::query('SELECT  COUNT(*)
+                                                 FROM  emails
+                                                WHERE  email = {?}', $email);
+                            if ($res->fetchOneCell() > 0) {
+                                $valid_emails[] = $email;
+                            } else {
+                                $invalid_emails[] = "$orig_email: no such redirection";
+                            }
                         }
                     }
                 }
                         }
                     }
                 }
@@ -925,7 +928,7 @@ L'équipe d'administration <support@" . $globals->mail->domain . '>';
 
                 // Output the list of users with recently broken addresses,
                 // along with the count of valid redirections.
 
                 // Output the list of users with recently broken addresses,
                 // along with the count of valid redirections.
-                require_once 'include/notifs.inc.php';
+                require_once 'notifs.inc.php';
                 pl_content_headers("text/x-csv");
 
                 $csv = fopen('php://output', 'w');
                 pl_content_headers("text/x-csv");
 
                 $csv = fopen('php://output', 'w');