From: hickert Date: Fri, 12 Mar 2010 13:35:22 +0000 (+0000) Subject: Updated userFilter::getFilter to return valid multi query filters X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=230ac16c3c8696965eea1f8d384062bcdbee74b4;p=gosa.git Updated userFilter::getFilter to return valid multi query filters git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16489 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_userFilter.inc b/gosa-core/include/class_userFilter.inc index f713e4860..2bcf9ffd4 100644 --- a/gosa-core/include/class_userFilter.inc +++ b/gosa-core/include/class_userFilter.inc @@ -217,10 +217,11 @@ class userFilter extends plugin if(!isset($tmp['name'])) continue; // Remove line breaks from the filter, which may were added for better reading. - $c = preg_split('/\n/',$tmp['filter']); - - foreach($c as $key => $str) $c[$key] = trim($str); - $tmp['filter'] = implode($c); + foreach($tmp['queries'] as $key => $query){ + $c = preg_split('/\n/',$query['filter']); + foreach($c as $key => $str) $c[$key] = trim($str); + $tmp['queries'][$key]['filter'] = implode($c); + } // The filter is visible if it is shared or if is one of our own creations. // ... and enabled. diff --git a/gosa-core/include/class_userFilterEditor.inc b/gosa-core/include/class_userFilterEditor.inc index f118b5618..68c26fe64 100644 --- a/gosa-core/include/class_userFilterEditor.inc +++ b/gosa-core/include/class_userFilterEditor.inc @@ -204,6 +204,7 @@ class userFilterEditor extends plugin if(isset($filter->searches[$this->parent])){ $query = $filter->searches[$this->parent]['query']['filter']; $backend = $filter->searches[$this->parent]['query']['backend']; + print_a($filter->searches[$this->parent]); } $this->queries[] = array('backend'=> $backend, 'filter' => userFilterEditor::_autoIndentFilter($query," "));