From c1234e9789d87e0d0f7e3196f55ef588b1a575a2 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 2 Apr 2008 08:33:46 +0000 Subject: [PATCH] Fixed functions inc get_ou -Do not append ',' to fetched department names, if department is absolute (ou=sudoers,dc=gonicus,dc=de) git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10102 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 5caf26ea7..1926e94f0 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -1166,10 +1166,17 @@ function get_ou($name) if ($ou != ""){ if (!preg_match('/^[^=]+=[^=]+/', $ou)){ - return @LDAP::convert("ou=$ou,"); + $ou = @LDAP::convert("ou=$ou"); } else { - return @LDAP::convert("$ou,"); + $ou = @LDAP::convert("$ou"); } + + if(preg_match("/".normalizePreg($config->current['BASE'])."$/",$ou)){ + return($ou); + }else{ + return("$ou,"); + } + } else { return ""; } -- 2.30.2