From: cajus Date: Thu, 8 Oct 2009 08:11:45 +0000 (+0000) Subject: Added inverse filter X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f874c0450133f7de0f92370dcde3706a0e3ca790;p=gosa.git Added inverse filter git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14562 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_listing.inc b/gosa-core/include/class_listing.inc index c2c020748..24b8cba92 100644 --- a/gosa-core/include/class_listing.inc +++ b/gosa-core/include/class_listing.inc @@ -778,11 +778,19 @@ class listing { } // Skip entry if the pseudo filter does not fit - if (isset($action['filter']) && preg_match('/^[a-z0-9_]+=[a-z0-9_]+$/i', $action['filter'])) { + if (isset($action['filter']) && preg_match('/^[a-z0-9_]+!?=[a-z0-9_]+$/i', $action['filter'])) { list($fa, $fv)= split('=', $action['filter']); - if (!isset($this->entries[$row][$fa]) && !$this->entries[$row][$fa][0] == $fv) { - $result.= " "; - continue; + if (preg_match('/^(.*)!$/', $fa, $m)){ + $fa= $m[1]; + if (isset($this->entries[$row][$fa]) && $this->entries[$row][$fa][0] == $fv) { + $result.= " "; + continue; + } + } else { + if (!isset($this->entries[$row][$fa]) && !$this->entries[$row][$fa][0] == $fv) { + $result.= " "; + continue; + } } }