From eadd0ab010e9b8ef70156407f6aaebb1efdc1567 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 8 Jan 2010 13:00:17 +0000 Subject: [PATCH] Display opsi hots too git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15126 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_filterSYSTEMS.inc | 30 +++++++++++++++++++ .../systems/admin/systems/system-filter.xml | 4 +-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc b/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc index 725d549eb..5b1d87ae7 100644 --- a/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc +++ b/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc @@ -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); } diff --git a/gosa-plugins/systems/admin/systems/system-filter.xml b/gosa-plugins/systems/admin/systems/system-filter.xml index 583e9a2c3..cb511afdb 100644 --- a/gosa-plugins/systems/admin/systems/system-filter.xml +++ b/gosa-plugins/systems/admin/systems/system-filter.xml @@ -10,7 +10,7 @@ SYSTEMS - (&(|$SERVER $WORKSTATION $TERMINAL $PRINTER $COMPONENT $WINSTATION $INCOMING)$NAME) + (&(|$SERVER $WORKSTATION $TERMINAL $PRINTER $COMPONENT $WINSTATION $INCOMING $OPSI)$NAME) dn objectClass cn @@ -92,7 +92,7 @@ OPSI true - (objectClass=goWorkstation) + (&(objectClass=FAIclass)(FAIstate=__NETBOOT__)) -- 2.30.2