summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f3f1ea5)
raw | patch | inline | side by side (parent: f3f1ea5)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 8 Apr 2008 06:58:12 +0000 (06:58 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 8 Apr 2008 06:58:12 +0000 (06:58 +0000) |
-Fixed Add system/user acls
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10264 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10264 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc | patch | blob | history | |
gosa-plugins/sudo/admin/sudo/class_target_list_systems.inc | patch | blob | history |
diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc
index a7697f1bb08eb766918476d5bd80f423c85eaa6f..05a1a13d51ef45ad407c25d1275e823d32328833 100644 (file)
}
}
+
+ /* Get global filter config */
+ if (!session::is_set("sysfilter")){
+ $ui= get_userinfo();
+ $base= get_base_from_people($ui->dn);
+ $sysfilter= array( "depselect" => $base,
+ "regex" => "*");
+ session::set("sysfilter", $sysfilter);
+ }
}
/* Show ws dialog */
if ($this->show_ws_dialog){
- $this->display_trust_add_dialog();
+ return($this->display_trust_add_dialog());
}
$regex= $sysfilter['regex'];
$filter= "(&(|(objectClass=goServer)(objectClass=gotoWorkstation)(objectClass=gotoTerminal))$exclude(cn=*)(cn=$regex))";
- $deps_a = array(get_ou("serverou"),
- get_ou("terminalou"),
- get_ou("workstationou"));
+ $res = array();
+ $res= array_merge($res,get_sub_list($filter, array("terminal"), get_ou("terminalou"),
+ get_ou("systemsou").$sysfilter['depselect'], array("cn"), GL_SUBSEARCH | GL_SIZELIMIT));
+ $res= array_merge($res,get_sub_list($filter, array("server"), get_ou("serverou"),
+ get_ou("systemsou").$sysfilter['depselect'], array("cn"), GL_SUBSEARCH | GL_SIZELIMIT));
+ $res= array_merge($res,get_sub_list($filter, array("workstation"), get_ou("workstationou"),
+ get_ou("systemsou").$sysfilter['depselect'], array("cn"), GL_SUBSEARCH | GL_SIZELIMIT));
- $res= get_sub_list($filter, array("terminal","server","workstation"), $deps_a,
- get_ou("systemsou").$sysfilter['depselect'], array("cn"), GL_SUBSEARCH | GL_SIZELIMIT);
$wslist= array();
foreach ($res as $attrs){
$wslist[]= preg_replace('/\$/', '', $attrs['cn'][0]);
"sudoUser" => _("Users"),
"sudoHost" => _("Host"),
"sudoCommand" => _("Command"),
- "sudoRunAs" => _("Run as user"))
+ "sudoRunAs" => _("Run as user"),
+ "trustModel" => _("Access control list"))
));
}
}
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 2437da5fb47cf6644050270173b0bdb1d90764ec..e46b946f889bd330725b9dde84d783a47811c913 100644 (file)
}
/* Load possible departments */
- $tdeps= $ui->get_module_departments(array("server","terminal","workstation"));
+ $tdeps= array();
+ $tdeps= array_merge($tdeps,$ui->get_module_departments("server"));
+ $tdeps= array_merge($tdeps,$ui->get_module_departments("terminal"));
+ $tdeps= array_merge($tdeps,$ui->get_module_departments("workstation"));
+ $tdeps = array_unique($tdeps);
+
$ids = $this->config->idepartments;
$first = "";
$found = FALSE;
$filter = "";
$Regex = $this->Regex;
- $chk = array(
- "terminal" => "(objectClass=gotoTerminal)",
- "server" => "(objectClass=goServer)" ,
- "workstation" => "(objectClass=gotoWorkstation)");
-
- /* Create filter */
- foreach($chk as $chkBox => $FilterPart){
- if($this->$chkBox){
- $filter .= $FilterPart;
- }
- }
$filter= "(&(cn=".$Regex.")(|".$filter."))";
if($this->SubSearch){
- $res= get_list($filter, array("terminal","workstation","server"), $base,
- array("cn","objectClass","gosaGroupObjects","description"), GL_SIZELIMIT | GL_SUBSEARCH);
+ $res= array();
+ if($this->terminal){
+ $filter = "(objectClass=gotoTerminal)";
+ $filter= "(&(cn=".$Regex.")(|".$filter."))";
+ $res= array_merge($res,get_sub_list($filter,"terminal",get_ou('terminalou'),$base,
+ array("cn","objectClass","description"), GL_SIZELIMIT | GL_SUBSEARCH));
+ }
+ if($this->workstation){
+ $filter = "(objectClass=gotoWorkstation)";
+ $filter= "(&(cn=".$Regex.")(|".$filter."))";
+ $res= array_merge($res,get_sub_list($filter, "workstation", get_ou('workstationou'),$base,
+ array("cn","objectClass","description"), GL_SIZELIMIT | GL_SUBSEARCH));
+ }
+ if($this->server){
+ $filter = "(objectClass=goServer)";
+ $filter = "(&(cn=".$Regex.")(|".$filter."))";
+ $res= array_merge($res,get_sub_list($filter, "server", get_ou('serverou'),$base,
+ array("cn","objectClass","description"), GL_SIZELIMIT | GL_SUBSEARCH));
+ }
}else{
- $res= get_list($filter, "terminal", get_ou('terminalou').$base,
- array("cn","objectClass","description"), GL_SIZELIMIT );
- $res= array_merge($res,get_list($filter, "workstation", get_ou('workstationou').$base,
- array("cn","objectClass","description"), GL_SIZELIMIT ));
- $res= array_merge($res,get_list($filter, "server", get_ou('serverou').$base,
- array("cn","objectClass","description"), GL_SIZELIMIT ));
-
- $deps_a = array(
- get_ou("workstationou"),
- get_ou("terminalou"),
- get_ou("serverou"));
-
- $res = get_sub_list($filter,array("server","terminal","workstation"),
- $deps_a,get_ou("systemsou").$base,array("cn","objectClass","description"),GL_SIZELIMIT);
+ $res= array();
+ if($this->terminal){
+ $filter = "(objectClass=gotoTerminal)";
+ $filter= "(&(cn=".$Regex.")(|".$filter."))";
+ $res= array_merge($res,get_list($filter,"terminal", get_ou('terminalou').$base,
+ array("cn","objectClass","description"), GL_SIZELIMIT ));
+ }
+ if($this->workstation){
+ $filter = "(objectClass=gotoWorkstation)";
+ $filter= "(&(cn=".$Regex.")(|".$filter."))";
+ $res= array_merge($res,get_list($filter, "workstation", get_ou('workstationou').$base,
+ array("cn","objectClass","description"), GL_SIZELIMIT ));
+ }
+ if($this->server){
+ $filter = "(objectClass=goServer)";
+ $filter = "(&(cn=".$Regex.")(|".$filter."))";
+ $res= array_merge($res,get_list($filter, "server", get_ou('serverou').$base,
+ array("cn","objectClass","description"), GL_SIZELIMIT ));
+ }
}
$this->list= $res;