From: Gunnar Wrobel Date: Tue, 2 Jun 2009 19:16:51 +0000 (+0200) Subject: Support selecting the master server for write access. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a1ad442861da236f14e1115674f425943369eea0;p=horde.git Support selecting the master server for write access. --- diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server.php b/framework/Kolab_Server/lib/Horde/Kolab/Server.php index 55e790047..34b2270c4 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server.php @@ -206,6 +206,24 @@ abstract class Horde_Kolab_Server } /** + * Get the connection to the master server for write access. + * + * @return Horde_Kolab_Server The Horde_Kolab_Server reference to the master + * server. + */ + function &getMaster() + { + if (!isset($this->params['host_master']) + || !emtpy($this->params['write']) + || $this->params['host_master'] == $this->params['host']) { + return $this; + } + $params = $this->params; + $params['write'] = true; + return Horde_Kolab_Server::singleton($params); + } + + /** * Stores the attribute definitions in the cache. * * @return Horde_Kolab_Server The concrete Horde_Kolab_Server reference.