From: hickert Date: Fri, 8 Jan 2010 15:48:09 +0000 (+0000) Subject: Updated filter... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ed38a8508b0e132f1f593e1ced4166883f160943;p=gosa.git Updated filter... git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15127 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc b/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc index 5b1d87ae7..9a4df16ee 100644 --- a/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc +++ b/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc @@ -74,38 +74,37 @@ 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; - } + global $config; + $ui = get_userinfo(); + if(preg_match("/FAIstate=__NETBOOT__/", $filter) && + class_available('opsi') && + $base == $config->current['BASE']){ + + // Check ACLs and opsi handle + $opsi_acl = $ui->get_permissions($base,"opsi/opsiProperties"); + $opsi = new opsi($config); + $objects = array(); + if($opsi instanceof opsi && $opsi->enabled() && preg_match("/r/",$opsi_acl)){ + + // Get list of opsi hosts + $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/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index c3efc23d9..3845cef7b 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -46,8 +46,8 @@ class systemManagement extends management $tD = $this->getObjectDefinitions(); $sP = array(); foreach($tD as $entry){ - if(!empty($entry['RDN'])) - $sP[] = $entry['RDN']; + if(!empty($entry['ou'])) + $sP[] = $entry['ou']; } $this->storagePoints = array_unique($sP); @@ -55,25 +55,25 @@ class systemManagement extends management # if (session::global_is_set(get_class($this)."_filter")){ # $filter= session::global_get(get_class($this)."_filter"); # } else { - $filter = new filter(get_template_path("system-filter.xml", true)); - $filter->setObjectStorage($this->storagePoints); + $filter = new filter(get_template_path("system-filter.xml", true)); + $filter->setObjectStorage($this->storagePoints); # } - $this->setFilter($filter); + $this->setFilter($filter); - // Build headpage - $headpage = new listing(get_template_path("system-list.xml", true)); - $headpage->setFilter($filter); + // Build headpage + $headpage = new listing(get_template_path("system-list.xml", true)); + $headpage->setFilter($filter); - $filter->setConverter('INCOMING', 'systemManagement::incomingFilterConverter'); + $filter->setConverter('INCOMING', 'systemManagement::incomingFilterConverter'); - // Add copy&paste and snapshot handler. - if ($this->config->boolValueIsTrue("main", "copyPaste")){ - $this->cpHandler = new CopyPasteHandler($this->config); - } - if($this->config->get_cfg_value("enableSnapshots") == "true"){ - $this->snapHandler = new SnapshotHandler($this->config); - } - parent::__construct($config, $ui, "systems", $headpage); + // Add copy&paste and snapshot handler. + if ($this->config->boolValueIsTrue("main", "copyPaste")){ + $this->cpHandler = new CopyPasteHandler($this->config); + } + if($this->config->get_cfg_value("enableSnapshots") == "true"){ + $this->snapHandler = new SnapshotHandler($this->config); + } + parent::__construct($config, $ui, "systems", $headpage); } static function incomingFilterConverter($filter) @@ -83,121 +83,140 @@ class systemManagement extends management return(preg_replace("/%systemIncomingRDN/", $rdn,$filter)); } - - /*! \brief Overridden render method of class mangement. - * this allows us to add a release selection box. - */ -function renderList() -{ - $headpage = $this->getHeadpage(); - $headpage->update(); - - $tD = $this->getObjectDefinitions(); - $smarty = get_smarty(); - foreach($tD as $name => $obj){ - $smarty->assign("USE_".$name, (empty($obj['TABNAME']) || class_available($obj['TABNAME']))); + function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") + { + $headpage = $this->getHeadpage(); + foreach($target as $id){ + $type = $headpage->getType($id); + echo $type."
"; + } } - $display = $headpage->render(); - return($this->getHeader().$display); -} + + + /*! \brief Overridden render method of class mangement. + * this allows us to add a release selection box. + */ + function renderList() + { + $headpage = $this->getHeadpage(); + $headpage->update(); + + $tD = $this->getObjectDefinitions(); + $smarty = get_smarty(); + foreach($tD as $name => $obj){ + $smarty->assign("USE_".$name, (empty($obj['TABNAME']) || class_available($obj['TABNAME']))); + } + + $display = $headpage->render(); + return($this->getHeader().$display); + } public function getObjectDefinitions() { + +# "workstation" => array( +# "RDN" => get_ou('workstationRDN'), +# "CLASS" => "WORKTABS", +# "TABNAME" => "workgeneric", +# "TABCLASS"=> "worktabs", +# "ACLC" => "workstation", +# "ACL" => "workstation/workgeneric" ), + + $tabs = array( - "incoming" => array( - "RDN" => get_ou('systemIncomingRDN'), - "CLASS" => "", - "TABNAME" => "", - "TABCLASS" => "", - "ACLC" => "incoming", - "ACL" => "incoming/systems"), - - "ArpNewDevice"=> array( - "RDN" => get_ou('systemIncomingRDN'), - "CLASS" => "TERMTABS", - "TABNAME" => "termgeneric" , - "TABCLASS" => "termtabs", - "ACLC" => "incoming", - "ACL" => "incoming/systems"), - - "NewDevice" => array( - "RDN" => get_ou('systemIncomingRDN'), - "CLASS" => "TERMTABS", - "TABNAME" => "termgeneric", - "TABCLASS" => "termtabs", - "ACLC" => "incoming", - "ACL" => "incoming/systems"), - - "terminal" => array( - "RDN" => get_ou('terminalRDN'), - "CLASS" => "TERMTABS", - "TABNAME" => "termgeneric", - "TABCLASS" => "termtabs", - "ACLC" => "terminal", - "ACL" => "terminal/termgeneric"), - - "workstation" => array( - "RDN" => get_ou('workstationRDN'), - "CLASS" => "WORKTABS", - "TABNAME" => "workgeneric", - "TABCLASS"=> "worktabs", - "ACLC" => "workstation", - "ACL" => "workstation/workgeneric" ), - - "server" => array( - "RDN" => get_ou('serverRDN'), - "CLASS" => "SERVTABS", - "TABNAME" => "servgeneric", - "TABCLASS"=> "servtabs", - "ACLC" => "server", - "ACL" => "server/servgeneric"), - - "printer" => array( - "RDN" => get_ou('printerRDN'), - "CLASS" => "PRINTTABS", - "TABNAME" => "printgeneric", - "TABCLASS"=> "printtabs", - "ACLC" => "printer", - "ACL" => "printer/printgeneric"), - - "phone" => array( - "RDN" => get_ou('phoneRDN'), - "CLASS" => "PHONETABS", - "TABNAME" => "phoneGeneric", - "TABCLASS"=> "phonetabs", - "ACLC" => "phone", - "ACL" => "phone/phoneGeneric"), - - "winstation" => array( - "RDN" => get_winstations_ou(), - "CLASS" => "WINTABS", - "TABNAME" => "wingeneric", - "TABCLASS"=> "wintabs", - "ACLC" => "winworkstation", - "ACL" => "winworkstation/wingeneric"), - - "component" => array( - "RDN" => get_ou('componentRDN'), - "CLASS" => "COMPONENTTABS", - "TABNAME" => "componentGeneric", - "TABCLASS"=> "componenttabs", - "ACLC" => "component", - "ACL" => "component/componentGeneric"), - - "opsi_client" => array( - "RDN" => "", - "CLASS" => "OPSITABS", - "TABNAME" => "opsiGeneric" , - "TABCLASS"=> "opsi_tabs", - "ACLC" => "opsi" , - "ACL" => "opsi/opsiGeneric")); + "FAKE_OC_OpsiHost" => array( + "ou" => "", + "plugClass" => "opsiGeneric", + "tabClass" => "opsi_tabs", + "tabDesc" => "OPSITABS", + "aclClass" => "opsiGeneric", + "aclCategory" => "opsi"), + + "goServer" => array( + "ou" => get_ou('serverRDN'), + "plugClass" => "servgeneric", + "tabClass" => "servtabs", + "tabDesc" => "SERVTABS", + "aclClass" => "servgeneric", + "aclCategory" => "server"), + + "gotoWorkstation" => array( + "ou" => get_ou('workstationRDN'), + "plugClass" => "workgeneric", + "tabClass" => "worktabs", + "tabDesc" => "WORKTABS", + "aclClass" => "workstation", + "aclCategory" => "workgeneric"), + + "gotoTerminal" => array( + "ou" => get_ou('terminalRDN'), + "plugClass" => "termgeneric", + "tabClass" => "termtabs", + "tabDesc" => "TERMTABS", + "aclClass" => "terminal", + "aclCategory" => "termgeneric"), + + "gotoPrinter" => array( + "ou" => get_ou('printerRDN'), + "plugClass" => "printgeneric", + "tabClass" => "printtabs", + "tabDesc" => "PRINTABS", + "aclClass" => "printer", + "aclCategory" => "printgeneric"), + + "FAKE_OC_NewDevice" => array( + "ou" => get_ou('systemIncomingRDN'), + "plugClass" => "termgeneric", + "tabClass" => "termtabs", + "tabDesc" => "TERMTABS", + "aclClass" => "terminal", + "aclCategory" => "termgeneric"), + + "goFonHardware" => array( + "ou" => get_ou('phoneRDN'), + "plugClass" => "phoneGeneric", + "tabClass" => "phonetabs", + "tabDesc" => "PHONETABS", + "aclClass" => "phone", + "aclCategory" => "phoneGeneric"), + + "FAKE_OC_winstation" => array( + "ou" => get_winstations_ou(), + "plugClass" => "wingeneric", + "tabClass" => "wintabs", + "tabDesc" => "WINTABS", + "aclClass" => "wingeneric", + "aclCategory" => "winworkstation"), + + "ieee802Device" => array( + "ou" => get_ou('componentRDN'), + "plugClass" => "componentGeneric", + "tabClass" => "componenttabs", + "tabDesc" => "COMPONENTTABS", + "aclClass" => "componentGeneric", + "aclCategory" => "component"), + ); + + // Now map some special types + $tabs['FAKE_OC_NewWorkstation'] = &$tabs['gotoWorkstation']; + $tabs['FAKE_OC_NewTerminal'] = &$tabs['gotoTerminal']; + $tabs['FAKE_OC_NewServer'] = &$tabs['gotoWorkstation']; + $tabs['gotoWorkstation__IS_BUSY'] = &$tabs['gotoWorkstation']; + $tabs['gotoWorkstation__IS_ERROR'] = &$tabs['gotoWorkstation']; + $tabs['gotoWorkstation__IS_LOCKED'] = &$tabs['gotoWorkstation']; + $tabs['gotoTerminal__IS_BUSY'] = &$tabs['gotoTerminal']; + $tabs['gotoTerminal__IS_ERROR'] = &$tabs['gotoTerminal']; + $tabs['gotoTerminal__IS_LOCKED'] = &$tabs['gotoTerminal']; + $tabs['goServer__IS_BUSY'] = &$tabs['goServer']; + $tabs['goServer__IS_ERROR'] = &$tabs['goServer']; + $tabs['goServer__ISLOCKED'] = &$tabs['goServer']; + + $tabs['FAKE_OC_NewUnknownDevice'] = &$tabs['FAKE_OC_NewDevice']; return($tabs); } - - } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-plugins/systems/admin/systems/system-filter.tpl b/gosa-plugins/systems/admin/systems/system-filter.tpl index a0f1e50f6..d27452049 100644 --- a/gosa-plugins/systems/admin/systems/system-filter.tpl +++ b/gosa-plugins/systems/admin/systems/system-filter.tpl @@ -7,31 +7,31 @@
- {if $USE_server} + {if $USE_goServer} {$SERVER} {t}Show servers{/t}
{/if} - {if $USE_workstation} + {if $USE_gotoWorkstation} {$WORKSTATION} {t}Show workstations{/t}
{/if} - {if $USE_terminal} + {if $USE_gotoTerminal} {$TERMINAL} {t}Show terminals{/t}
{/if} - {if $USE_printer} + {if $USE_gotoPrinter} {$PRINTER} {t}Show network printer{/t}
{/if} - {if $USE_phone} + {if $USE_goFonHardware} {$PHONE} {t}Show phones{/t}
{/if} - {if $USE_winstation} + {if $USE_FAKE_OC_winstation} {$WINSTATION} {t}Show windows based workstations{/t}
{/if} - {if $USE_component} + {if $USE_ieee802Device} {$COMPONENT} {t}Show network devices{/t}
{/if} - {if $USE_incoming} + {if $USE_FAKE_OC_NewWorkstation || $USE_FAKE_OC_NewTerminal || $USE_FAKE_OC_NewServer || $USE_FAKE_OC_NewDevice || $USE_FAKE_OC_NewUnknownDevice} {$INCOMING} {t}Show incoming devices{/t}
{/if} - {if $USE_opsi_client} + {if $USE_FAKE_OC_OpsiHost} {$OPSI} {t}Show OPSI based clients{/t}
{/if} diff --git a/gosa-plugins/systems/admin/systems/system-list.xml b/gosa-plugins/systems/admin/systems/system-list.xml index ad2068a0c..de478353b 100644 --- a/gosa-plugins/systems/admin/systems/system-list.xml +++ b/gosa-plugins/systems/admin/systems/system-list.xml @@ -11,6 +11,14 @@ 1 + + + FAKE_OC_OpsiHost + opsi + opsiGeneric + plugins/systems/images/select_winstation.png + + FAKE_OC_NewWorkstation