From 5eb03e4557b691447f6b6af572582e43f62443d7 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 7 Jun 2006 07:59:47 +0000 Subject: [PATCH] Some updates git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3666 594d385d-05f5-0310-b6e9-bd551577e9d8 --- contrib/gosa.conf | 8 ++- plugins/admin/systems/class_goShareServer.inc | 52 +++++++++++++++++++ ...verService.inc => class_serverService.inc} | 0 3 files changed, 55 insertions(+), 5 deletions(-) rename plugins/admin/systems/{class_ServerService.inc => class_serverService.inc} (100%) diff --git a/contrib/gosa.conf b/contrib/gosa.conf index 3d842d242..36a074e37 100644 --- a/contrib/gosa.conf +++ b/contrib/gosa.conf @@ -124,9 +124,7 @@ - - - + {servKolab} @@ -255,8 +253,8 @@ kde_applications_menu="" compile="/var/spool/gosa" resolution_hook="/etc/gosa/resolutions" - additionalrestrictionfilters="/bin/echo ''" - additionalprotocolls ="/bin/echo ''" + additionalrestrictionfilters="/bin/echo ''" + additionalprotocolls ="/bin/echo ''" lang="" theme="default" debuglevel="0" diff --git a/plugins/admin/systems/class_goShareServer.inc b/plugins/admin/systems/class_goShareServer.inc index 5775aee0a..7c35e429c 100644 --- a/plugins/admin/systems/class_goShareServer.inc +++ b/plugins/admin/systems/class_goShareServer.inc @@ -21,6 +21,8 @@ class goShareServer extends plugin{ var $goShareServerStatus = ""; var $goExportEntry = array(); var $allow_mounts = false; + var $mounts_to_remove = array(); + var $mounts_to_add = array(); function goShareServer($config,$dn) { @@ -263,6 +265,56 @@ class goShareServer extends plugin{ unset($this->goExportEntryList[$id]); } + function process_mounts() { + + $clip = "cn=" . $this->cn . ",ou=servers,ou=systems,"; + $mountsdn = "cn=mounts," . substr($this->dn, strlen($clip)); + + $mounts = array( + "objectClass" => "container", + "cn" => "mounts" + ); + + # load data from mounts container + $ldap = $this->config->get_ldap_link(); + $ldap->cat($mountsdn, array('dn')); + $attrs = $ldap->fetch(); + + # mounts container not present yet, so we create it + if (count($attrs) == 0) { + $ldap->cd($mountsdn); + $ldap->add($mounts); + show_ldap_error($ldap->get_error(), _("Creating mount container failed")); + gosa_log("Mount container '$mountsdn' has been created"); + } + + # remove deleted mounts from the container + foreach ($this->mounts_to_remove as $entry) { + $mount=$this->returnMountEntry($entry); + $mountdn = "cn=".$mount["cn"].","."$mountsdn"; + + $ldap->cat($mountdn, array('dn')); + $attrs = $ldap->fetch(); + + if (count($attrs) != 0) { + $ldap->rmdir($mountdn); + show_ldap_error($ldap->get_error(), _("Removing mount container failed")); + gosa_log("Mount object '".$mountdn."' has been removed"); + } + } + + # 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); + $ldap->add($mount); + show_ldap_error($ldap->get_error(), _("Saving mount container failed")); + gosa_log("Mount object '".$mountdn."' has been added"); + } + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/class_ServerService.inc b/plugins/admin/systems/class_serverService.inc similarity index 100% rename from plugins/admin/systems/class_ServerService.inc rename to plugins/admin/systems/class_serverService.inc -- 2.30.2