Code

Updated a couple of files for case insensitivity
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Nov 2009 16:48:26 +0000 (16:48 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Nov 2009 16:48:26 +0000 (16:48 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14787 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/users/class_userManagement.inc
gosa-plugins/fai/admin/fai/class_FAI.inc
gosa-plugins/fai/admin/fai/class_faiManagement.inc
gosa-plugins/fai/admin/fai/class_faiPackage.inc
gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc
gosa-plugins/goto/admin/applications/class_applicationGeneric.inc
gosa-plugins/goto/admin/devices/class_deviceGeneric.inc

index aef3056f3c0cba0e8684f10b51383480af101fae..27ed27e18fbd1fe019139acfbee6693e9e1fc5ba 100644 (file)
@@ -491,7 +491,7 @@ class userManagement extends management
       // Adapt template values.
       $template_dn              = $_POST['template'];
       $this->tabObject->adapt_from_template($template_dn, array("uid","cn","givenName","sn"));
-      $template_base            = preg_replace("/^[^,]+,".preg_quote(get_people_ou(), '/')."/", '', $template_dn);
+      $template_base            = preg_replace("/^[^,]+,".preg_quote(get_people_ou(), '/i')."/", '', $template_dn);
       $this->tabObject->by_object['user']->base= $template_base;
 
       // The user Tab object is already instantiated, so just go back and let the 
index 4dd7d36e135fb1be2d2468e8f1cad390a3798c44..698203dc0e6aba024ed3a583467a6444eec6d9bc 100644 (file)
@@ -166,7 +166,7 @@ class FAI
   {
     global $config;
 
-    if(!preg_match("/".preg_quote(get_ou('faiBaseRDN'), '/')."/",$dn)){
+    if(!preg_match("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",$dn)){
       $base = get_ou('faiBaseRDN').$dn;
     }else{
       $base = $dn;
@@ -178,7 +178,7 @@ class FAI
     $ldap->search("(objectClass=FAIbranch)",array("ou","dn"));
     while($attrs = $ldap->fetch()){
       if($appendedName){
-        $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".preg_quote(get_ou('faiBaseRDN'), '/').".*$/","",$attrs['dn']));
+        $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".preg_quote(get_ou('faiBaseRDN'), '/').".*$/i","",$attrs['dn']));
       }else{
         $res[$attrs['dn']] = $attrs['ou'][0];
       }
@@ -222,7 +222,7 @@ class FAI
 
       /* Dont't try to modify non FAIclasses  
        */
-      if(!preg_match("/[^,]+,".preg_quote(get_ou("faiBaseRDN"), '/')."/",$obj_dn)){
+      if(!preg_match("/[^,]+,".preg_quote(get_ou("faiBaseRDN"), '/')."/i",$obj_dn)){
         trigger_error("PLEASE check fai class handling in ".__LINE__." -> ".__FILE__);        
         echo "<br>-->".$Current_DN."<br>";
         echo "<br>-->".$obj_dn."<br>";
@@ -923,7 +923,7 @@ class FAI
     $ldap->search("(objectClass=FAIbranch)",array("ou","FAIstate"));
     while($attrs = $ldap->fetch()){
       foreach($sub_releases as $sub_rel){
-        if(preg_match("/^".preg_quote($sub_rel.get_ou('faiBaseRDN'), '/')."/",$attrs['dn'])){
+        if(preg_match("/^".preg_quote($sub_rel.get_ou('faiBaseRDN'), '/')."/i",$attrs['dn'])){
           $f_releases[$sub_rel.get_ou('faiBaseRDN')] = $attrs;
         }
       }
index 5d41a5560f967618f2e257df0be94eca1e5d79e7..c9f3da869c18216718a4339414755745a7d70ddd 100644 (file)
@@ -554,9 +554,9 @@ class faiManagement extends plugin
 
             $ldap->cd($bb);
             $ldap->recursive_remove();
-            $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'/', ','.get_ou('applicationRDN'), $bb));
+            $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'/i', ','.get_ou('applicationRDN'), $bb));
             $ldap->recursive_remove();
-            $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'/', ','.get_ou('mimetypeRDN'), $bb));
+            $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'/i', ','.get_ou('mimetypeRDN'), $bb));
             $ldap->recursive_remove();
 
             /* Search for all groups with configured application menus.
@@ -564,7 +564,7 @@ class faiManagement extends plugin
               - The search für menu configuration for the specified release and collect all those dns.
               - Remove entries
              */
-            $release_ou = preg_replace("/".preg_quote(get_ou("faiBaseRDN"), '/').".*$/","",$bb);
+            $release_ou = preg_replace("/".preg_quote(get_ou("faiBaseRDN"), '/').".*$/i","",$bb);
             $ldap->cd($this->config->current['BASE']);
             $ldap->search("(objectClass=posixGroup)",array("dn"));
           
@@ -706,11 +706,11 @@ class faiManagement extends plugin
           }
         }
 
-        $appsrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/",get_ou('applicationRDN'),$baseToUse); 
-        $appdst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/",get_ou('applicationRDN'),"ou=".$name.",".$baseToUse) ; 
+        $appsrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",get_ou('applicationRDN'),$baseToUse); 
+        $appdst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",get_ou('applicationRDN'),"ou=".$name.",".$baseToUse) ; 
 
-        $mimesrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/",get_ou('mimetypeRDN'),$baseToUse); 
-        $mimedst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/",get_ou('mimetypeRDN'),"ou=".$name.",".$baseToUse) ; 
+        $mimesrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",get_ou('mimetypeRDN'),$baseToUse); 
+        $mimedst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",get_ou('mimetypeRDN'),"ou=".$name.",".$baseToUse) ; 
 
         /* Check if source depeartments exist */
         foreach(array($baseToUse,$appsrc,$mimesrc) as $dep){
index a18c3c8eaf9761d7d8aa83a7766b4a3b90843bb9..88fb15dc02268bb1c8cf4c00004457a2dd5380e3 100644 (file)
@@ -173,7 +173,7 @@ class faiPackage extends plugin
 
       /* Assemble release name */
       $release = $this->parent->parent->fai_release;
-      $tmp= preg_replace('/[,]*'.preg_quote(get_ou('faiBaseRDN'), '/').'.*$/', '', $release);
+      $tmp= preg_replace('/[,]*'.preg_quote(get_ou('faiBaseRDN'), '/').'.*$/i', '', $release);
       $tmp= preg_replace('/ou=/', '', $tmp);
       $rev= array_reverse(split(',', $tmp));
       $this->FAIdebianRelease= "/";
@@ -571,7 +571,7 @@ class faiPackage extends plugin
     if($this->FAIdebianRelease == "ClearFromCopyPaste"){
 
       $current_release  = $this->parent->parent->fai_release;
-      $tmp= preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'.*$/', '', $current_release);
+      $tmp= preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'.*$/i', '', $current_release);
       $tmp= preg_replace('/ou=/', '', $tmp);
       $rev= array_reverse(split(',', $tmp));
       $this->FAIdebianRelease= "";
index f322d0b6d3c46131189073b017aefee718e67e8c..b706bd4d91114f09b9245d58a530c74c175cd990 100644 (file)
@@ -69,7 +69,7 @@ class faiSummaryTab extends plugin{
       /* Get Classes and release */
       $this->Classes = $this->parent->by_object['faiProfile']->FAIclasses;
       $this->base    = $this->parent->by_object['faiProfile']->parent->parent->fai_release;
-      $str = preg_replace("/^.*".preg_quote(get_ou('faiProfileRDN'), '/')."/","",$this->dn);
+      $str = preg_replace("/^.*".preg_quote(get_ou('faiProfileRDN'), '/')."/i","",$this->dn);
       $tmp  = $this->parent->by_object['faiProfile']->parent->parent->getBranches();
       $this->Release = $tmp[$this->base];
   
index b6caa4d92e41ee5becc1d495299430004d078fb3..d5295027af1121ef10545e880d0d941023694668 100644 (file)
@@ -57,7 +57,7 @@ class application extends plugin
         $this->base= dn2base($ui->dn);
       }
     } else {
-      $this->base= preg_replace ("/^[^,]+,".get_ou('applicationRDN')."/", "", $this->dn);
+      $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou('applicationRDN'), '/')."/i", "", $this->dn);
     }
 
     $this->orig_cn = $this->cn;
@@ -230,7 +230,7 @@ class application extends plugin
     restore_error_handler();
 
     /* Parse release out of object dn */
-    $release = preg_replace("/".get_ou("applicationRDN").preg_quote($this->base, '/')."$/","",$this->dn);
+    $release = preg_replace("/".preg_quote(get_ou("applicationRDN").$this->base, '/')."$/i","",$this->dn);
     $release = preg_replace("/^cn=[^,]+,/","",$release);
 
     /* Get a list of all groups 
index ac4c810c6abf35eae088cd6fe601c23091d4b9a6..1ceff18aead292a53e171c80c9989a57b608808a 100644 (file)
@@ -55,7 +55,7 @@ class deviceGeneric extends plugin
         $this->base= dn2base($ui->dn);
       }
     } else {
-      $this->base =preg_replace ("/^[^,]+,".get_ou('deviceRDN')."/","",$this->dn);
+      $this->base =preg_replace ("/^[^,]+,".preg_quote(get_ou('deviceRDN'), '/')."/i","",$this->dn);
     }
     $this->orig_base = $this->base;
     $this->orig_dn   = $this->dn;