From 088fea9b47fe62d894af8d170077f95d296bbc76 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 11 Apr 2006 12:11:41 +0000 Subject: [PATCH] fixed dn cut git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3034 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/functions.inc b/include/functions.inc index b98e65917..ef7100de8 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -798,8 +798,13 @@ function convert_department_dn2($dn) if(isset($deps[$dn])){ $dn= $deps[$dn]; $dep = preg_replace("/^.*=/","",$dn); - }else{ - if(preg_match("/=/",$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; -- 2.30.2