From 230ac16c3c8696965eea1f8d384062bcdbee74b4 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 12 Mar 2010 13:35:22 +0000 Subject: [PATCH] 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 --- gosa-core/include/class_userFilter.inc | 9 +++++---- gosa-core/include/class_userFilterEditor.inc | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) 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," ")); -- 2.30.2