From ff616a839804a81b39f2fcb2ea40fe1641b921b1 Mon Sep 17 00:00:00 2001 From: SJ Date: Sat, 16 Feb 2013 13:54:41 +0100 Subject: [PATCH] webui fixes --- webui/model/search/search.php | 14 ++++++++++++-- webui/model/stat/counter.php | 18 ------------------ 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/webui/model/search/search.php b/webui/model/search/search.php index 07eab227..fede7a4d 100644 --- a/webui/model/search/search.php +++ b/webui/model/search/search.php @@ -622,8 +622,13 @@ class ModelSearchSearch extends Model { array_push($arr, $id); if(Registry::get('auditor_user') == 1 && RESTRICTED_AUDITOR == 1) { + if(validdomain($_SESSION['domain']) == 1) { + $q .= ",?"; + array_push($a, $_SESSION['domain']); + } + while(list($k, $v) = each($_SESSION['auditdomains'])) { - if(validdomain($v) == 1) { + if(validdomain($v) == 1 && !in_array($v, $a)) { $q .= ",?"; array_push($a, $v); } @@ -676,8 +681,13 @@ class ModelSearchSearch extends Model { $q2 = preg_replace("/^\,/", "", $q2); if(Registry::get('auditor_user') == 1 && RESTRICTED_AUDITOR == 1) { + if(validdomain($_SESSION['domain']) == 1) { + $q .= ",?"; + array_push($a, $_SESSION['domain']); + } + while(list($k, $v) = each($_SESSION['auditdomains'])) { - if(validdomain($v) == 1) { + if(validdomain($v) == 1 && !in_array($v, $a)) { $q .= ",?"; array_push($a, $v); } diff --git a/webui/model/stat/counter.php b/webui/model/stat/counter.php index d16a51b5..7eb3e53b 100644 --- a/webui/model/stat/counter.php +++ b/webui/model/stat/counter.php @@ -33,24 +33,6 @@ class ModelStatCounter extends Model { } - public function reset_counters(){ - - if(MEMCACHED_ENABLED) { - $memcache = Registry::get('memcache'); - - $c = Registry::get('counters'); - unset($c[MEMCACHED_PREFIX . 'size']); - - foreach ($c as $counter) { - $memcache->set($counter, 0); - } - } - - $query = $this->db->query("UPDATE " . TABLE_COUNTER . " SET `rcvd`=0, `virus`=0, `duplicate`=0, `ignore`=0"); - - return 0; - } - } ?>