From: hickert Date: Wed, 27 Jan 2010 09:50:29 +0000 (+0000) Subject: Updated sudo to use the generic user/group select dialogs X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=63bd526b64d8bb5315770dce62e02b591c67139a;p=gosa.git Updated sudo to use the generic user/group select dialogs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15356 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc index 628da1b60..acab2b3fa 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc @@ -178,25 +178,19 @@ class sudo extends plugin /********************* Add users *********************/ - + if(isset($_POST['list_sudoUser']) && !is_object($this->dialog) && $this->acl_is_writeable("sudoUser")){ - $used = array(); - foreach($this->sudoUser as $name){ - $used[] = preg_replace("/^!/","",$name); - } - $this->dialog =new target_list_users($this->config,$used); + $this->dialog =new userGroupSelect($this->config,get_userinfo()); } /* Add selected hosts to the sudoUser list */ - if(isset($_POST['SavetargetSelectDialog']) && $this->dialog instanceof target_list_users){ + if(isset($_POST['userGroupSelect_save']) && $this->dialog instanceof userGroupSelect){ if($this->acl_is_writeable("sudoUser")){ foreach($this->dialog->save() as $entry){ if(in_array("posixGroup",$entry['objectClass'])){ $name = trim("%".$entry['cn'][0]); }elseif(isset($entry['uid'][0])){ $name = trim($entry['uid'][0]); - }else{ - print_a($entry); } if(!in_array($name,$this->sudoUser) && !in_array("!".$name,$this->sudoUser)){ $this->sudoUser[] = $name; @@ -207,6 +201,28 @@ class sudo extends plugin $this->dialog = NULL; } + if(isset($_POST['userGroupSelect_cancel']) && $this->dialog instanceOf userGroupSelect){ + unset($this->dialog); + $this->dialog = NULL; + } + + if($this->dialog instanceOf userGroupSelect){ + $used = array(); + foreach($this->sudoUser as $name){ + $str = preg_replace("/^!/","",$name); + if(preg_match("/^%/", $str)){ + $used['cn'][] = preg_replace("/^%/","",$str); + }else{ + $used['uid'][] = $str; + } + } + + // Build up blocklist + session::set('filterBlacklist', $used); + return($this->dialog->execute()); + } + + /********************* Add systems @@ -239,7 +255,7 @@ class sudo extends plugin Dialog handling / display / close *********************/ - if(isset($_POST['ClosetargetSelectDialog']) && is_object($this->dialog)){ + if(isset($_POST['userGroupSelect_cancel']) && is_object($this->dialog)){ unset($this->dialog); $this->dialog = NULL; } @@ -462,10 +478,6 @@ class sudo extends plugin $this->cn = "defaults"; } - if(is_object($this->dialog)){ - $this->dialog->save_object(); - } - /* Trust mode - special handling */ if($this->acl_is_writeable("trustModel")){ if (isset($_POST['trustmode'])){ diff --git a/gosa-plugins/sudo/admin/sudo/trust_machines.tpl b/gosa-plugins/sudo/admin/sudo/trust_machines.tpl deleted file mode 100644 index f7b0b2ca2..000000000 --- a/gosa-plugins/sudo/admin/sudo/trust_machines.tpl +++ /dev/null @@ -1,42 +0,0 @@ - - - - - -
-
-

- {t}Select systems to add{/t} {$hint}
-

-
-
-

- -

-
-
-
-

[F]{ -t}Filters{/t}

-
-
- - {$alphabet} -
- -
 {t}Display systems of department{/t}
- -
 {t}Display systems matching{/t}
- {$apply} -
-
- -

- -   - -