diff --git a/etc/example.conf b/etc/example.conf index 8d7e5545..6af079a1 100644 --- a/etc/example.conf +++ b/etc/example.conf @@ -55,6 +55,7 @@ piler_header_field=X-piler: piler already archived this email ; whether to archive an email not having a Message-ID header line (1) ; or not (0). ; If enabled then piler will assign piler_id as the message-id +; to messages without message-id. archive_emails_not_having_message_id=0 diff --git a/webui/model/search/search.php b/webui/model/search/search.php index 0620aef9..0c8de574 100644 --- a/webui/model/search/search.php +++ b/webui/model/search/search.php @@ -293,11 +293,13 @@ class ModelSearchSearch extends Model { $q = ""; - foreach($query->rows as $a) { - array_push($ids, $a['id']); + if(isset($query->rows)) { + foreach($query->rows as $a) { + array_push($ids, $a['id']); - if($q) { $q .= ",?"; } - else { $q = "?"; } + if($q) { $q .= ",?"; } + else { $q = "?"; } + } } diff --git a/webui/model/stat/counter.php b/webui/model/stat/counter.php index add39409..763a6c5b 100644 --- a/webui/model/stat/counter.php +++ b/webui/model/stat/counter.php @@ -12,7 +12,7 @@ class ModelStatCounter extends Model { $counter = $memcache->get(Registry::get('counters')); if(isset($counter[MEMCACHED_PREFIX . 'counters_last_update'])) { - $asize = nice_size($counter[MEMCACHED_PREFIX . 'size'], ' '); + if(isset($counter[MEMCACHED_PREFIX . 'size'])) { $asize = nice_size($counter[MEMCACHED_PREFIX . 'size'], ' '); } unset($counter[MEMCACHED_PREFIX . 'size']); return array ($asize, $counter); diff --git a/webui/model/user/auth.php b/webui/model/user/auth.php index b344d16e..31f37f59 100644 --- a/webui/model/user/auth.php +++ b/webui/model/user/auth.php @@ -19,7 +19,7 @@ class ModelUserAuth extends Model { $_SESSION['domain'] = $query->row['domain']; $_SESSION['realname'] = $query->row['realname']; - $_SESSION['emails'] = $this->model_user_user->get_users_all_email_addresses($query->row['uid'], $query->row['gid']); + $_SESSION['emails'] = $this->model_user_user->get_users_all_email_addresses($query->row['uid']); AUDIT(ACTION_LOGIN, $username, '', '', 'successful auth against user table'); diff --git a/webui/model/user/user.php b/webui/model/user/user.php index a9b7658f..57126668 100644 --- a/webui/model/user/user.php +++ b/webui/model/user/user.php @@ -45,7 +45,7 @@ class ModelUserUser extends Model { } - public function get_users_all_email_addresses($uid = 0, $gid = 0) { + public function get_users_all_email_addresses($uid = 0) { $data = array(); $uids = $uid; @@ -73,7 +73,7 @@ class ModelUserUser extends Model { if(isset($query->rows)) { foreach ($query->rows as $q) { - if(!in_array($email, $data)) { array_push($data, $q['email']); } + if(!in_array($q['email'], $data)) { array_push($data, $q['email']); } } }