From 42f59c2850b5cbd42863e29957911542af81414f Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 14 Dec 2005 15:13:26 +0000 Subject: [PATCH] Fixed ou=people zu get_people_ou git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2312 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/addons/ldapmanager/class_exportxls.inc | 2 +- .../admin/applications/class_applicationManagement.inc | 8 +++++++- plugins/admin/ogroups/class_ogroupManagement.inc | 8 +++++++- plugins/admin/systems/class_systemManagement.inc | 10 +++++++++- plugins/admin/users/class_userManagement.inc | 8 +++++++- plugins/gofax/blocklists/class_blocklistManagement.inc | 8 +++++++- plugins/gofon/macro/class_gofonMacroManagement.inc | 8 +++++++- 7 files changed, 45 insertions(+), 7 deletions(-) diff --git a/plugins/addons/ldapmanager/class_exportxls.inc b/plugins/addons/ldapmanager/class_exportxls.inc index 47a787064..ea03de074 100644 --- a/plugins/addons/ldapmanager/class_exportxls.inc +++ b/plugins/addons/ldapmanager/class_exportxls.inc @@ -65,7 +65,7 @@ class xlsexport extends plugin // Set values for optionlist in form $smarty->assign("deplist", $this->config->idepartments); - $smarty->assign("choicelist",array("ou=people,"=>"users" ,"ou=groups,"=>"groups" ,"ou=computers,ou=systems,"=>"computers","ou=servers,ou=systems,"=>"servers","dc=addressbook,"=>"addressbook")); + $smarty->assign("choicelist",array(get_people_ou()=>"users" ,"ou=groups,"=>"groups" ,"ou=computers,ou=systems,"=>"computers","ou=servers,ou=systems,"=>"servers","dc=addressbook,"=>"addressbook")); // Get the LDAP link, to generate the Export $ldap = $this->config->get_ldap_link(); diff --git a/plugins/admin/applications/class_applicationManagement.inc b/plugins/admin/applications/class_applicationManagement.inc index 8bdc6bbe9..26cb834c5 100644 --- a/plugins/admin/applications/class_applicationManagement.inc +++ b/plugins/admin/applications/class_applicationManagement.inc @@ -445,7 +445,13 @@ class applicationManagement extends plugin * We also need to search for the departments * So we are able to navigate like in konquerer */ - $base2 = preg_replace("/ou=people,/i","",$base); + $peopleOU = get_people_ou(); + + if(empty($peopleOU)){ + $base2 = $base; + }else{ + $base2 = preg_replace("/".$peopleOU."/i","",$base); + } $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", TRUE, $base2, array("ou", "description"), TRUE); diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index d1be42cd1..975b2396e 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -583,7 +583,13 @@ name='dep_root' alt='"._("Root")."'> ". * We also need to search for the departments * So we are able to navigate like in konquerer */ - $base2 = preg_replace("/ou=people,/i","",$base); + $peopleOU = get_people_ou(); + + if(empty($peopleOU)){ + $base2 = $base; + }else{ + $base2 = preg_replace("/".$peopleOU."/i","",$base); + } $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", TRUE, $base2, array("ou", "description"), TRUE); diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index b64fb5e77..7f7265767 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -875,7 +875,15 @@ class systems extends plugin * We also need to search for the departments * So we are able to navigate like in konquerer */ - $base2 = preg_replace("/ou=people,/i","",$base); + + $peopleOU = get_people_ou(); + + if(empty($peopleOU)){ + $base2 = $base; + }else{ + $base2 = preg_replace("/".$peopleOU."/i","",$base); + } + $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", TRUE, $base2, array("ou", "description"), TRUE); diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index 78eb404db..e77badd55 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -991,7 +991,13 @@ class userManagement extends plugin */ /* Create base to search in */ - $base2 = preg_replace("/ou=people,/i","",$base); + + $peopleOU = get_people_ou(); + if(empty($peopleOU)) { + $base2 = $base; + }else{ + $base2 = preg_replace("/".$peopleOU."/i","",$base); + } /* Get all departments within this subtree */ $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", diff --git a/plugins/gofax/blocklists/class_blocklistManagement.inc b/plugins/gofax/blocklists/class_blocklistManagement.inc index f3a2e6c70..10f053541 100644 --- a/plugins/gofax/blocklists/class_blocklistManagement.inc +++ b/plugins/gofax/blocklists/class_blocklistManagement.inc @@ -448,7 +448,13 @@ class blocklist extends plugin * We also need to search for the departments * So we are able to navigate like in konquerer */ - $base2 = preg_replace("/ou=people,/i","",$base); + $peopleBase = get_people_ou(); + if(empty($peopleBase)){ + $base2 = $base; + }else{ + $base2 = preg_replace("/".$peopleBase.",/i","",$base); + } + $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", TRUE, $base2, array("ou", "description"), TRUE); diff --git a/plugins/gofon/macro/class_gofonMacroManagement.inc b/plugins/gofon/macro/class_gofonMacroManagement.inc index d0fe77f60..78bf95528 100755 --- a/plugins/gofon/macro/class_gofonMacroManagement.inc +++ b/plugins/gofon/macro/class_gofonMacroManagement.inc @@ -446,7 +446,13 @@ class gofonMacro extends plugin * We also need to search for the departments * So we are able to navigate like in konquerer */ - $base2 = preg_replace("/ou=people,/i","",$base); + $peopleOU = get_people_ou(); + + if(empty($peopleOU)){ + $base2 = $base; + }else{ + $base2 = preg_replace("/".$peopleOU."/i","",$base); + } $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", TRUE, $base2, array("ou", "description"), TRUE); -- 2.30.2