Code

Display opsi hots too
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Jan 2010 13:00:17 +0000 (13:00 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Jan 2010 13:00:17 +0000 (13:00 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15126 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc
gosa-plugins/systems/admin/systems/system-filter.xml

index 725d549eb50eff3796be5c6819b3f10849b67651..5b1d87ae7e8b4f37811ab05c5aa2cd8011357613 100644 (file)
@@ -73,6 +73,36 @@ class filterSYSTEMS {
       }
     }
 
+    // Append opsi stuff ...
+    if(preg_match("/FAIstate=__NETBOOT__/", $filter)){
+      global $config;
+      $ui = get_userinfo();
+      if(class_available('opsi') && $base == $config->current['BASE']){
+        $opsi = new opsi($config);
+        $objects = array();
+        if($opsi instanceof opsi && $opsi->enabled()){
+          $opsi_acl = $ui->get_permissions($base,"opsi/opsiProperties");
+          if(preg_match("/r/",$opsi_acl)){
+            $opsi_clients = $opsi->get_hosts_for_system_management();
+            if($opsi->is_error()){
+              msg_dialog::display(_("Error"),msgPool::siError($opsi->get_error()),ERROR_DIALOG);
+            }else{
+              foreach($opsi_clients as $entry){
+                $entry['objectClass'] = array("FAKE_OC_OpsiHost");
+                $item = array('count' => count($entry));
+                foreach($entry as  $name => $value){
+                  $item[] = $name;
+                  $item[$name] = $value;
+                }
+                $entries[] = $item;
+              }
+            }
+          } 
+        }
+      }
+    }
+  
+
     return($entries);
   }
 
index 583e9a2c3b9172d03ca04250722b6447faa556f1..cb511afdbd0f1a47a6b91924323299a050586517 100644 (file)
@@ -10,7 +10,7 @@
   <search>
     <query>
       <backend>SYSTEMS</backend>
-      <filter>(&amp;(|$SERVER $WORKSTATION $TERMINAL $PRINTER $COMPONENT $WINSTATION $INCOMING)$NAME)</filter>
+      <filter>(&amp;(|$SERVER $WORKSTATION $TERMINAL $PRINTER $COMPONENT $WINSTATION $INCOMING $OPSI)$NAME)</filter>
       <attribute>dn</attribute>
       <attribute>objectClass</attribute>
       <attribute>cn</attribute>
@@ -92,7 +92,7 @@
     <tag>OPSI</tag>
     <default>true</default>
     <unset></unset>
-    <set>(objectClass=goWorkstation)</set>
+    <set>(&amp;(objectClass=FAIclass)(FAIstate=__NETBOOT__))</set>
   </element>
 
   <element>