From: cajus Date: Wed, 12 Apr 2006 14:50:52 +0000 (+0000) Subject: Reverted modifications, wrong fixes in wrong location X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1303267483de3d5adb1605a6e10143cb253764d4;p=gosa.git Reverted modifications, wrong fixes in wrong location git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3040 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/functions.inc b/include/functions.inc index 2de43011a..0c47bada4 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -514,10 +514,7 @@ function get_list2($subtreeACL, $filter, $subsearch= TRUE, $base="", $attrs= arr $dn= $ldap->getDN(); foreach ($subtreeACL as $key => $value){ if (preg_match("/$key/", $dn)){ - $dnAlias = preg_replace("/^ou=/","",$dn); - $dnAlias = preg_replace("/,o.*$/","",$dnAlias); - $dnAlias = preg_replace('/###GOSAREPLACED###/', ',', $dnAlias); - $attrs["dn"]=$dnAlias; + $attrs["dn"]= convert_department_dn($dn); $result[]= $attrs; break; } @@ -793,16 +790,8 @@ function convert_department_dn($dn) function convert_department_dn2($dn) { - -/* - - I think this no longer used ... - Check this, and remove this function - - -*/ - $dep= ""; + /* Build a sub-directory style list of the tree level specified in $dn */ $deps = array_flip($_SESSION['config']->idepartments); @@ -810,17 +799,8 @@ function convert_department_dn2($dn) if(isset($deps[$dn])){ $dn= $deps[$dn]; $dep = preg_replace("/^.*=/","",$dn); - }else{ - global $config; - $base = "ou="; - if(isset($config->current['BASE'])){ - $base = $config->current['BASE']; - } - if(preg_match("%".$base."%",$dn)){ - $dep= preg_replace("%^.*\/([^\/]+)$%", "\\1", $dn); - }else{ - $dep = $dn; - } + }else{ + $dep= preg_replace("%^.*/([^/]+)$%", "\\1", $dn); } /* Return and remove accidently trailing slashes */