Code

removed undefined ...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Sep 2005 05:57:39 +0000 (05:57 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Sep 2005 05:57:39 +0000 (05:57 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1276 594d385d-05f5-0310-b6e9-bd551577e9d8

include/functions.inc

index 3c85199dc2281f00a58e67aa39be85828e18225c..26ae481b5911bbc1be64be92f6474ad366c4ba4d 100644 (file)
@@ -760,12 +760,14 @@ function convert_department_dn2($dn)
      specified in $dn */
   $deps = array_flip($_SESSION['config']->idepartments);
 
-  $dn= $deps[$dn];
-
-  $tmp = split (",", $dn);
-
-//  $dep= preg_replace("%^.*/([^/]+)$%", "\\1", $tmp[0]);
-  $dep = preg_replace("/^.*=/","",$tmp[0]);
+  if(isset($deps[$dn])){
+    $dn= $deps[$dn];
+    $tmp = split (",", $dn);
+    $dep = preg_replace("/^.*=/","",$tmp[0]);
+  }else{
+    $tmp = split (",", $dn);
+    $dep= preg_replace("%^.*/([^/]+)$%", "\\1", $tmp[0]);
+  }
 
   /* Return and remove accidently trailing slashes */
   $tmp = rtrim($dep, "/");