Code

Fixed multi query editor
[gosa.git] / gosa-core / include / class_userFilter.inc
index f713e4860bb517565245444406ee8f7ed5b792ee..c7da3badbe3eb6ad75544067c77ad6da94b52c6d 100644 (file)
@@ -206,6 +206,7 @@ class userFilter extends plugin
   static function getFilter($category=array())
   {
     global $config;
+
     $ldap=$config->get_ldap_link();
     $ui = get_userinfo();
     $ldap->cd($config->current['BASE']);
@@ -217,19 +218,17 @@ 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 $cKey => $str) $c[$cKey] = trim($str);
+          $tmp['queries'][$key]['filter'] = mb_convert_encoding(implode($c),'UTF-8');
+        }
  
         // The filter is visible if it is shared or if is one of our own creations.
         //  ... and enabled.
         $visible = in_array('enable', $tmp['flags']) && 
           ($attrs['dn'] == $ui->dn || in_array('share', $tmp['flags']));
          
-        // Convert filter encoding
-        $tmp['filter'] = mb_convert_encoding($tmp['filter'], 'UTF-8');
         // Add filter if it matches the category list
         if($visible && (count($category) == 0 || array_intersect($category, $tmp['categories']))){ 
           $filter[$tmp['name']] = $tmp;