Code

Updated function convert_department_dn works without config now.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 11 Jun 2008 13:15:50 +0000 (13:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 11 Jun 2008 13:15:50 +0000 (13:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11288 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/functions.inc

index dd8f69efa6364965b0f6509aa584a5b3e49ebca8..62ca20be90ef9dd3ef3e39363cb94139ba1f7d7a 100644 (file)
@@ -1105,14 +1105,18 @@ function &get_smarty()
 }
 
 
-function convert_department_dn($dn)
+function convert_department_dn($dn, $base = NULL)
 {
+  global $config;
   $dep= "";
 
+  if($base == NULL){
+    $base = $config->current['BASE'];
+  }
+
   /* Build a sub-directory style list of the tree level
      specified in $dn */
-  global $config;
-  $dn = preg_replace("/".normalizePreg($config->current['BASE'])."$/i","",$dn);
+  $dn = preg_replace("/".normalizePreg($base)."$/i","",$dn);
   if(empty($dn)) return("/");
 
   foreach (split(',', $dn) as $rdn){