Code

Some functions were missing.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 12 Jul 2006 06:01:24 +0000 (06:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 12 Jul 2006 06:01:24 +0000 (06:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4111 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_goShareServer.inc

index 5bb45523c4e20647958acf6bdb44607ff7f75b5f..87c854608e5056a0cc460271eb29c17849bbb348 100644 (file)
@@ -305,7 +305,6 @@ class goShareServer extends plugin{
 
     # add new mounts to the container
     foreach ($this->mounts_to_add as $entry) {
-
       $mount=$this->returnMountEntry($entry);
       $mountdn = "cn=".$mount["cn"].","."$mountsdn";
       $ldap->cd($mountdn);
@@ -374,6 +373,73 @@ class goShareServer extends plugin{
     }
   }
 
+
+  function addToMountList($entry) 
+  {
+    $key =  key($entry);
+    $type = $this->get_share_type($entry[$key]);
+    if (($type == "netatalk") || ($type == "NFS")) {
+      $this->mounts_to_add[$entry[$key]] = $entry[$key];
+      unset($this->mounts_to_remove[$entry[$key]]);
+    }
+  }
+
+  function deleteFromMountList($entry) 
+  {
+    $type = $this->get_share_type($entry);
+    if (($type == "netatalk") || ($type == "NFS")) {
+      $this->mounts_to_remove[$entry] = $entry;
+      unset($this->mounts_to_add[$entry]);
+    }
+  }
+
+  function get_share_type($share) 
+  {
+    $tmp = split("\|", $share);
+    return $tmp[2];
+  }
+
+  function returnMountEntry($entry)
+  {
+    $item = split("\|", $entry);
+    $name = $item[0];
+    $description = $item[1];
+    $type = $item[2];
+    $charset = $item[3];
+    $path = $item[4];
+    $options = $item[5];
+
+    switch ($type) {
+      case "netatalk" : {
+        $mount = array(
+            "mountDirectory" => "/Network/Servers/",
+            "mountOption" => array(
+              "net",
+              "url==afp://;AUTH=NO%20USER%20AUTHENT@".$this->cn."/$name/"
+              ),
+            "mountType" => "url",
+            "objectClass" => "mount",
+            "cn" => $this->cn .":/".$name
+            );
+        break;
+      }
+      case "NFS" : {
+        $mount = array(
+            "mountDirectory" => "/Network/Servers/",
+            "mountOption" => "net",
+            "mountType" => "nfs",
+            "objectClass" => "mount",
+            "cn" => $this->cn .":".$path
+            );
+        break;
+      }
+      default : {
+                  continue;
+                }
+    }
+    return $mount;
+  }
+
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>