Code

Updated system management
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 3 Jul 2008 12:53:33 +0000 (12:53 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 3 Jul 2008 12:53:33 +0000 (12:53 +0000)
-Only list object/checkboxes that are readable, selectable.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11525 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_divListSystem.inc
gosa-plugins/systems/admin/systems/class_systemManagement.inc

index 89838f7ff1c8d113575d77aeb3e48e8f0b39fc0a..fd8153a02cb8b2c83799cddc2341197b85fbfd90 100644 (file)
@@ -94,27 +94,42 @@ class divListSystem extends MultiSelectWindow
     $this->AddHeader(array("string"=>_("Actions"),"attach"=>"style='width:".$action_col_size."px;border-right:0px;'"));
 
     /*                  Text        ,Value    ,Name         ,Is selected */
-    $this->AddCheckBox("ShowServers",        
-        msgPool::selectToView(  _("servers")),            
-        sprintf(_("Show %s"),   _("servers")),true);
-    $this->AddCheckBox("ShowTerminals",       
-        msgPool::selectToView(  _("Linux terminals")),    
-        sprintf(_("Show %s"),   _("terminals")),true);
-    $this->AddCheckBox("ShowWorkstations",
-        msgPool::selectToView(  _("Linux workstations")), 
-        sprintf(_("Show %s"),   _("workstations")),true);
-    $this->AddCheckBox("ShowWinWorkstations", 
-        msgPool::selectToView(  _("MicroSoft Windows based workstations")), 
-        sprintf(_("Show %s"),   _("windows based workstations")),true);
-    $this->AddCheckBox("ShowPrinters",
-        msgPool::selectToView(  _("network printers")),   
-        sprintf(_("Show %s"),   _("network printers")) ,true);
-    $this->AddCheckBox("ShowPhones",
-        msgPool::selectToView(  _("VoIP phones")),        
-        sprintf(_("Show %s"),   _("phones")) ,true);
-    $this->AddCheckBox("ShowDevices",
-        msgPool::selectToView(  _("network devices")),    
-        sprintf(_("Show %s"),   _("network devices")),  true);
+
+    if(class_available("servtabs")){
+      $this->AddCheckBox("ShowServers",        
+          msgPool::selectToView(  _("servers")),            
+          sprintf(_("Show %s"),   _("servers")),true);
+    }
+    if(class_available("termtabs")){
+      $this->AddCheckBox("ShowTerminals",       
+          msgPool::selectToView(  _("Linux terminals")),    
+          sprintf(_("Show %s"),   _("terminals")),true);
+    }
+    if(class_available("worktabs")){
+      $this->AddCheckBox("ShowWorkstations",
+          msgPool::selectToView(  _("Linux workstations")), 
+          sprintf(_("Show %s"),   _("workstations")),true);
+    }
+    if(class_available("wintabs")){
+      $this->AddCheckBox("ShowWinWorkstations", 
+          msgPool::selectToView(  _("MicroSoft Windows based workstations")), 
+          sprintf(_("Show %s"),   _("windows based workstations")),true);
+    }
+    if(class_available("printtabs")){
+      $this->AddCheckBox("ShowPrinters",
+          msgPool::selectToView(  _("network printers")),   
+          sprintf(_("Show %s"),   _("network printers")) ,true);
+    }
+    if(class_available("phonetabs")){
+      $this->AddCheckBox("ShowPhones",
+          msgPool::selectToView(  _("VoIP phones")),        
+          sprintf(_("Show %s"),   _("phones")) ,true);
+    }
+    if(class_available("componenttabs")){
+      $this->AddCheckBox("ShowDevices",
+          msgPool::selectToView(  _("network devices")),    
+          sprintf(_("Show %s"),   _("network devices")),  true);
+    }
 
     /* Add SubSearch checkbox */
     $this->AddCheckBox(SEPERATOR);
index ba4055ea0e1757d68865da81adced491add4c3d1..fbb80498e035f1d3a8af36c520a02cd65deacc5c 100644 (file)
@@ -1314,13 +1314,13 @@ class systems extends plugin
 
     /* This array represents the combination between checkboxes and search filters */
     $objs = array( 
-        "ShowServers"        => array("CLASS" => "goServer"        ,"TREE" => get_ou('serverou')),
-        "ShowTerminals"      => array("CLASS" => "gotoTerminal"    ,"TREE" => get_ou('terminalou')),
-        "ShowPrinters"       => array("CLASS" => "gotoPrinter"     ,"TREE" => get_ou('printerou')),
-        "ShowDevices"        => array("CLASS" => "ieee802Device"   ,"TREE" => get_ou('componentou')),
-        "ShowPhones"         => array("CLASS" => "goFonHardware"   ,"TREE" => get_ou('phoneou')),
-        "ShowWorkstations"   => array("CLASS" => "gotoWorkstation" ,"TREE" => get_ou('workstationou')),
-        "ShowWinWorkstations"=> array("CLASS" => $samba            ,"TREE" => get_winstations_ou() ));
+        "ShowServers"        => array("TAB" => "servtabs",      "CLASS" => "goServer"        ,"TREE" => get_ou('serverou')),
+        "ShowTerminals"      => array("TAB" => "termtabs",      "CLASS" => "gotoTerminal"    ,"TREE" => get_ou('terminalou')),
+        "ShowPrinters"       => array("TAB" => "printtabs",     "CLASS" => "gotoPrinter"     ,"TREE" => get_ou('printerou')),
+        "ShowDevices"        => array("TAB" => "componenttabs", "CLASS" => "ieee802Device"   ,"TREE" => get_ou('componentou')),
+        "ShowPhones"         => array("TAB" => "phonetabs",     "CLASS" => "goFonHardware"   ,"TREE" => get_ou('phoneou')),
+        "ShowWorkstations"   => array("TAB" => "worktabs",      "CLASS" => "gotoWorkstation" ,"TREE" => get_ou('workstationou')),
+        "ShowWinWorkstations"=> array("TAB" => "wintabs",       "CLASS" => $samba            ,"TREE" => get_winstations_ou() ));
 
     /* Include the 'Display Systems of user' attribute */ 
     if ((!empty($this->DivListSystem->UserRegex)) && ($this->DivListSystem->UserRegex!= "*")){
@@ -1339,7 +1339,8 @@ class systems extends plugin
 
     /* Walk through all possible search combinations, and search for some objects if the checkbox is enabled  */
     foreach($objs as $checkBox => $oc){
-      if($this->DivListSystem->$checkBox){
+
+      if($this->DivListSystem->$checkBox && class_available($oc['TAB'])){
         if($this->DivListSystem->SubSearch){
           if($oc['CLASS'] != ""){
             $filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))";