From 2589bdaaca3a6b94419c28e6dece5713f80f8e46 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 7 Apr 2008 08:33:12 +0000 Subject: [PATCH] Sudo -Updated list handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10222 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../sudo/admin/sudo/class_sudoGeneric.inc | 8 +++--- .../admin/sudo/class_target_list_systems.inc | 25 ++++--------------- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc index 4c19b95b9..16e0c5b5e 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc @@ -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; } diff --git a/gosa-plugins/sudo/admin/sudo/class_target_list_systems.inc b/gosa-plugins/sudo/admin/sudo/class_target_list_systems.inc index 0bfd3defe..2437da5fb 100644 --- a/gosa-plugins/sudo/admin/sudo/class_target_list_systems.inc +++ b/gosa-plugins/sudo/admin/sudo/class_target_list_systems.inc @@ -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 = ""._("Server").""; }elseif(in_array("gotoWorkstation",$val['objectClass'])){ $img = ""._("Workstation").""; }elseif(in_array("gotoTerminal",$val['objectClass'])){ $img = ""._("Terminal").""; - }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 ); -- 2.30.2