Code

Updated opsi filter.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 16 Mar 2010 06:36:29 +0000 (06:36 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 16 Mar 2010 06:36:29 +0000 (06:36 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16548 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_filterOPSIHOSTS.inc

index d3f44631ea1b4ee1f0e1d4d3396353b95cd94f21..48f7186595b9e370680654b5e41416c324ecf107 100644 (file)
@@ -11,11 +11,13 @@ class filterOPSIHOSTS {
 
     if(class_available('opsi') && $base == $config->current['BASE']){
 
+      // Explode filter into attribute and value to search for.
       $attr = $value = "";
+      $filter = preg_replace("/\*/",".*",$filter);
       if(preg_match("/=/", $filter)) {
         list($fAttr,$fValue) = preg_split("/=/", $filter);
       }
-      
       // Check ACLs and opsi handle
       $opsi_acl = $ui->get_permissions($base,"opsi/opsiProperties");
       $opsi = new opsi($config);
@@ -28,7 +30,6 @@ class filterOPSIHOSTS {
           msg_dialog::display(_("Error"),msgPool::siError($opsi->get_error()),ERROR_DIALOG);
         }else{
           foreach($opsi_clients as $entry){
-
             if(empty($fAttr) || preg_match("/{$fValue}/i",$entry[$fAttr][0])){
               $entry['objectClass'] = array("FAKE_OC_OpsiHost");
               $item = array('count' => count($entry));