Code

Sudo
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 7 Apr 2008 08:33:12 +0000 (08:33 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 7 Apr 2008 08:33:12 +0000 (08:33 +0000)
-Updated list handling

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

gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc
gosa-plugins/sudo/admin/sudo/class_target_list_systems.inc

index 4c19b95b9e39a9d0ba2e4ce59b75e5012d1fed62..16e0c5b5e04003b6261c7e11a91557fc3174820d 100644 (file)
@@ -116,8 +116,8 @@ class sudo extends plugin
    
     /* Add selected hosts  to the sudoUser list */ 
     if(isset($_POST['SaveMultiSelectWindow']) && $this->dialog instanceof target_list_users){
-      foreach($this->dialog->list_get_selected_items() as $id){
-        $cn = trim($this->dialog->list[$id]['uid'][0]);
+      foreach($this->dialog->save() as $entry){
+        $cn = trim($entry['uid'][0]);
         if(!in_array($cn,$this->sudoUser) && !in_array("!".$cn,$this->sudoUser)){
           $this->sudoUser[] = $cn;
         }
@@ -141,8 +141,8 @@ class sudo extends plugin
    
     /* Add selected hosts  to the sudoHost list */ 
     if(isset($_POST['SaveMultiSelectWindow']) && $this->dialog instanceof target_list_systems){
-      foreach($this->dialog->list_get_selected_items() as $id){
-        $cn = trim($this->dialog->list[$id]['cn'][0]);
+      foreach($this->dialog->save() as $entry){
+        $cn = trim($entry['cn'][0]);
         if(!in_array($cn,$this->sudoHost) && !in_array("!".$cn,$this->sudoHost)){
           $this->sudoHost[] = $cn;
         }
index 0bfd3defe6a2821c7126bd12f6ac536a6243a0ec..2437da5fb47cf6644050270173b0bdb1d90764ec 100644 (file)
@@ -34,15 +34,13 @@ class target_list_systems extends MultiSelectWindow
   var $Regex              = "*";
 
   /* CheckBoxes, to change default values modify $this->AddCheckBox */
-  var $ogroups        ;
   var $servers        ;
   var $workstations   ;
-  var $incoming       ;
+  var $terminals      ;
 
 
   /* Subsearch checkbox */
   var $SubSearch          ;
-  var $IPMatch            ;
   var $parent             ;
   var $ui                 ;
  
@@ -103,8 +101,7 @@ class target_list_systems extends MultiSelectWindow
     }
 
     /* Load possible departments */
-    $ui= get_userinfo();
-    $tdeps= $ui->get_module_departments("ogroups");
+    $tdeps= $ui->get_module_departments(array("server","terminal","workstation"));
     $ids = $this->config->idepartments;
     $first = "";
     $found = FALSE;
@@ -135,10 +132,6 @@ class target_list_systems extends MultiSelectWindow
       $this->selectedBase = $first;
     }
 
-    /* Get copy & paste icon */
-    $acls  = $ui->get_permissions($this->selectedBase,"ogroups/ogroup");
-    $acl_all= $ui->has_complete_category_acls($this->selectedBase,"ogroups");
-
     /* Add default header */
     $listhead = MultiSelectWindow::get_default_header();
 
@@ -172,7 +165,7 @@ class target_list_systems extends MultiSelectWindow
 
     $ui = get_userinfo();
 
-    // Assigning ogroups
+    // Assigning systems 
     foreach($list as $key => $val){
 
       if(in_array($val['cn'][0],$this->Targets_used) || 
@@ -184,22 +177,14 @@ class target_list_systems extends MultiSelectWindow
       }else{
         $desc = " - [ ".$val['description'][0]." ]";
       }
-      if(!isset($val['ipHostNumber'][0])){
-        $desc.= "";
-      }else{
-        $desc.= " - ".$val['ipHostNumber'][0]."";
-      }
-
 
-      $img ="Hmm";
+      $img ="?";
       if(in_array("goServer",$val['objectClass'])){
         $img = "<img src='images/select_server.png' alt='"._("Server")."' ".$title.">";
       }elseif(in_array("gotoWorkstation",$val['objectClass'])){
         $img = "<img src='images/select_workstation.png' alt='"._("Workstation")."' ".$title.">";
       }elseif(in_array("gotoTerminal",$val['objectClass'])){
         $img = "<img src='images/select_terminal.png' alt='"._("Terminal")."' ".$title.">";
-      }else{
-          print_a($val);
       }
 
       /* Create each field */
@@ -255,7 +240,7 @@ class target_list_systems extends MultiSelectWindow
 
     if($this->SubSearch){
       $res= get_list($filter, array("terminal","workstation","server"), $base, 
-            array("cn","objectClass","gosaGroupObjects","ipHostNumber","description"), GL_SIZELIMIT | GL_SUBSEARCH);
+            array("cn","objectClass","gosaGroupObjects","description"), GL_SIZELIMIT | GL_SUBSEARCH);
     }else{
       $res= get_list($filter, "terminal", get_ou('terminalou').$base, 
             array("cn","objectClass","description"), GL_SIZELIMIT );