Code

REplace stri_replace
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Sep 2006 08:01:35 +0000 (08:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Sep 2006 08:01:35 +0000 (08:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4626 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiHook.inc
plugins/admin/fai/class_faiPackage.inc
plugins/admin/fai/class_faiPartitionTable.inc
plugins/admin/fai/class_faiProfile.inc
plugins/admin/fai/class_faiScript.inc
plugins/admin/fai/class_faiTemplate.inc
plugins/admin/fai/class_faiVariable.inc

index a8f07b177898ca19b874e5edebd2913b440bcb91..cc94b04f4071943a9524d9954d65d1aaca50b5d9 100644 (file)
@@ -338,7 +338,8 @@ class faiHook extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
 
-    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+#    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+    $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $this->dn);
     if($_SESSION['faifilter']['branch'] == "main"){
       $use_dn = $this->dn;
     }
@@ -346,7 +347,8 @@ class faiHook extends plugin
     prepare_to_save_FAI_object($use_dn,array(),true);
 
     foreach($this->SubObjects as $name => $obj){
-      $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $obj['dn']);
+#      $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $obj['dn']);
+      $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $obj['dn']);
       if($_SESSION['faifilter']['branch'] == "main"){
         $use_dn = $obj['dn'];
       }
index 4591201beef8d0536c70a981b03f056e1970713b..9114c3bb9ca7db5c849756080cf64bbac3cfe7ca 100644 (file)
@@ -346,7 +346,8 @@ class faiPackage extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
 
-    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+#    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+    $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $this->dn);
     if($_SESSION['faifilter']['branch'] == "main"){
       $use_dn = $this->dn;
     }
@@ -356,7 +357,8 @@ class faiPackage extends plugin
     foreach($this->ConfiguredPackages as $pkgname => $attrs){
       foreach($attrs as $name => $attr){
         $pkgdn =  "FAIvariable=".$name.",".$this->dn;
-        $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $pkgdn);
+#        $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $pkgdn);
+        $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $pkgdn);
         if($_SESSION['faifilter']['branch'] == "main"){
           $use_dn = $obj['dn'];
         }
index 59a1cc5d390304dffc56cebd1ee777b891aaefd1..0e5e30921bcd7b8656b0d8b978f3a4e38dbdad6f 100644 (file)
@@ -305,7 +305,8 @@ class faiPartitionTable extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
 
-    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+#    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+    $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $this->dn);
     if($_SESSION['faifilter']['branch'] == "main"){
       $use_dn = $this->dn;
     }
@@ -315,7 +316,8 @@ class faiPartitionTable extends plugin
     foreach($this->disks as $disk){
 
       $disk_dn = "cn=".$disk['cn'].",".$this->dn;
-      $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $disk_dn);
+#      $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $disk_dn);
+      $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $disk_dn);
       if($_SESSION['faifilter']['branch'] == "main"){
         $use_dn = $disk_dn;
       }
@@ -324,7 +326,8 @@ class faiPartitionTable extends plugin
       foreach($disk['partitions'] as $key => $partition){    
      
         $partition_dn= "FAIpartitionNr=".$partition['FAIpartitionNr'].",".$disk_dn;      
-        $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $partition_dn);
+#        $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $partition_dn);
+        $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $partition_dn);
         if($_SESSION['faifilter']['branch'] == "main"){
           $use_dn = $disk_dn;
         }
index 53a511ad704386148e49ad0023971b19d2487f6b..c1e5c8f0f2c27992794e01a9a9ab0bf201287701 100644 (file)
@@ -352,7 +352,8 @@ class faiProfile extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
 
-    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+#    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+    $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $this->dn);
     if($_SESSION['faifilter']['branch'] == "main"){
       $use_dn = $this->dn;
     }
index 8807a6119e68bbda7828de8068c83bbf3cc92434..18f95aef3914979b9e15bf083de9f0ed5186c5c6 100644 (file)
@@ -328,7 +328,8 @@ class faiScript extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
 
-    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+#    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+    $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $this->dn);
     if($_SESSION['faifilter']['branch'] == "main"){
       $use_dn = $this->dn;
     }
@@ -336,7 +337,8 @@ class faiScript extends plugin
     prepare_to_save_FAI_object($use_dn,array(),true);
     
     foreach($this->SubObjects as $name => $obj){
-      $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $obj['dn']);
+#      $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $obj['dn']);
+      $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $obj['dn']);
       if($_SESSION['faifilter']['branch'] == "main"){
         $use_dn = $obj['dn'];
       }
index f20c357180a80f5d74fe312832a2c832ba0f19be..161d4fdcbfc438f5f945f84b9f945f858a0f694a 100644 (file)
@@ -310,7 +310,8 @@ class faiTemplate extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
 
-    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+#    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+    $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $this->dn);
     if($_SESSION['faifilter']['branch'] == "main"){
       $use_dn = $this->dn;
     }
@@ -318,7 +319,8 @@ class faiTemplate extends plugin
     prepare_to_save_FAI_object($use_dn,array(),true);
 
     foreach($this->SubObjects as $name => $obj){
-      $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $obj['dn']);
+#      $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $obj['dn']);
+      $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $obj['dn']);
       if($_SESSION['faifilter']['branch'] == "main"){
         $use_dn = $obj['dn'];
       }
index eb2c71c0562278b3b7d1a4cebcef3278cdd01326..ccc6170b6a1664490966b39433ac14abae69d9bd 100644 (file)
@@ -251,7 +251,8 @@ class faiVariable extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
 
-    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+#    $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+    $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $this->dn);
     if($_SESSION['faifilter']['branch'] == "main"){
       $use_dn = $this->dn;
     }
@@ -259,7 +260,8 @@ class faiVariable extends plugin
     prepare_to_save_FAI_object($use_dn,array(),true);
 
     foreach($this->SubObjects as $name => $obj){
-      $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $obj['dn']);
+#      $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $obj['dn']);
+      $use_dn = preg_replace("/".normalizePreg(get_release_dn($this->dn))."/i", $_SESSION['faifilter']['branch'], $obj['dn']);
       if($_SESSION['faifilter']['branch'] == "main"){
         $use_dn = $obj['dn'];
       }