From 1a7a2f33214af08332dbaa5c402ac7e4858fc6e6 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 11 Jun 2008 13:15:50 +0000 Subject: [PATCH] Updated function convert_department_dn works without config now. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11288 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index dd8f69efa..62ca20be9 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -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){ -- 2.30.2