From e1bf22f058266d04da312a6a12cc26fcda9bd930 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 12 Jul 2006 06:01:24 +0000 Subject: [PATCH] Some functions were missing. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4111 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_goShareServer.inc | 68 ++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/plugins/admin/systems/class_goShareServer.inc b/plugins/admin/systems/class_goShareServer.inc index 5bb45523c..87c854608 100644 --- a/plugins/admin/systems/class_goShareServer.inc +++ b/plugins/admin/systems/class_goShareServer.inc @@ -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: ?> -- 2.30.2