Code

Fixed fai package.
[gosa.git] / plugins / admin / fai / class_faiPartitionTable.inc
index c299d6d9ae84c0aeaa75eecd33648337da85b0c0..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;
         }
@@ -478,6 +481,31 @@ class faiPartitionTable extends plugin
     }
     $this->handle_post_events("add");
   }
+
+
+  /* Return plugin informations for acl handling */ 
+  function plInfo()
+  {
+    return (array( 
+          "plShortName" => _("Partition table"),
+          "plDescription" => _("FAI partition table"),
+          "plSelfModify"  => FALSE,
+          "plDepends"     => array(),
+          "plPriority"    => 0,
+          "plSection"     => array("administration"),
+          "plCategory"    => array("fai"),
+          "plProvidedAcls" => array(
+            "cn"                => _("Name"),
+            "FAIpartitionType"  => _("Partition type"),
+            "FAIpartitionNr"    => _("Partition no."),
+            "FAIfsType"         => _("File system type"),
+            "FAImountPoint"     => _("Mount point"),
+            "FAIpartitionSize"  => _("Partition size"),
+            "FAImountOptions"   => _("Mount options"),
+            "FAIfsOptions"      => _("File system options"),
+            "FAIpartitionFlags" => _("Partition flags"))
+          ));
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: