Code

Addressed issue with non case sensitive ou's. Only applies if your LDAP is not "clean".
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Jun 2006 04:37:46 +0000 (04:37 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Jun 2006 04:37:46 +0000 (04:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3971 594d385d-05f5-0310-b6e9-bd551577e9d8

include/functions.inc
plugins/addons/ldapmanager/class_csvimport.inc

index 2262718feee29e28c1302b785ac85c3c0d73e246..5571329521d721b0832561629486907ea2a346c0 100644 (file)
@@ -909,7 +909,7 @@ function get_base_from_people($dn)
 {
   global $config;
 
-  $pattern= "/^[^,]+,".preg_quote(get_people_ou())."/";
+  $pattern= "/^[^,]+,".preg_quote(get_people_ou())."/i";
   $base= preg_replace($pattern, '', $dn);
 
   /* Set to base, if we're not on a correct subtree */
@@ -1274,10 +1274,10 @@ function dn2base($dn)
   global $config;
 
   if (get_people_ou() != ""){
-    $dn= preg_replace('/,'.get_people_ou().'/' , ',', $dn);
+    $dn= preg_replace('/,'.get_people_ou().'/i' , ',', $dn);
   }
   if (get_groups_ou() != ""){
-    $dn= preg_replace('/,'.get_groups_ou().'/' , ',', $dn);
+    $dn= preg_replace('/,'.get_groups_ou().'/i' , ',', $dn);
   }
   $base= preg_replace ('/^[^,]+,/i', '', $dn);
 
index 3e3d0fd5802b072ca3894cd5f3648f1f0f1ec306..86fee5fc4d16573451760383b7f13ba69e040f6c 100644 (file)
@@ -84,7 +84,7 @@ class csvimport extends plugin
 
       while($temp = $ldap->fetch($this->csvinfo['templates'])){
         $tempvar ++;
-        $this->csvinfo['arrtemplates'][$tempvar] = $temp['sn'][0]." - ".$this->config->idepartments[preg_replace("/^[^,]+,".get_people_ou()."/", "", $temp['dn'])];
+        $this->csvinfo['arrtemplates'][$tempvar] = $temp['sn'][0]." - ".$this->config->idepartments[preg_replace("/^[^,]+,".get_people_ou()."/i", "", $temp['dn'])];
         $this->csvinfo['arrtempls']   [$tempvar]['name'] = $temp['sn'][0]; 
         $this->csvinfo['arrtempls']   [$tempvar]['dn']   = $temp['dn'];
       }