From bac1b39e7a562ce6aced9f5ca70e201f6b231dd4 Mon Sep 17 00:00:00 2001
From: Axel ROGER
Date: Fri, 9 Nov 2012 13:56:48 +0000
Subject: [PATCH] Bugfix: mails listing better displayed and doesn't return
wrong error anymore if we search a nonexistant mail
---
bureau/admin/mail_list.php | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/bureau/admin/mail_list.php b/bureau/admin/mail_list.php
index c2f24068..ddb93fb7 100644
--- a/bureau/admin/mail_list.php
+++ b/bureau/admin/mail_list.php
@@ -47,9 +47,10 @@ if(!$domain_id ) {
$fatal=false;
if ($domain=$dom->get_domain_byid($domain_id)) {
- if(!($mails_list = $mail->enum_domain_mails($domain_id,$search,$offset,$count,$show_systemmails))) {
+ if(!($mails_list = $mail->enum_domain_mails($domain_id,$search,$offset,$count,$show_systemmails)) && $search) {
$error=$err->errstr();
}
+ $allmails_list = $mail->enum_domain_mails($domain_id,$search,$offset,$count,'true');
} else {
$error=$err->errstr();
$fatal=true;
@@ -83,18 +84,17 @@ if ($quota->cancreate("mail")) {
-";
- __("No mails for this domain.");
- echo "
";
-} else {
- ?>
+
:
-
";
+ __("No mails for this domain.");
+ echo "
";
+} else {
+
if (isset($error) && !empty($error)) {
echo "$error
";
}
@@ -128,7 +128,8 @@ if (isset($error) && !empty($error)) {
$col=1; $i=0;
//listing of every mail of the current domain.
-while (list($key,$val)=each($mails_list)){
+if(!empty($mails_list)) {
+ while (list($key,$val)=each($mails_list)) {
$col=3-$col; $grey="";
?>
@@ -166,6 +167,7 @@ if (date("Y-m-d")==substr($val["lastlogin"],0,10)) echo substr($val["lastlogin"]