From: Gunnar Wrobel Date: Sun, 29 Mar 2009 21:08:06 +0000 (+0000) Subject: Add the getServer function for admins. This allows them to login too. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=209b1f3bb350cd9b7c155eee75e6db4e4ee260a1;p=horde.git Add the getServer function for admins. This allows them to login too. --- diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/administrator.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/administrator.php index cb9ad6907..ab7c20a8b 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/administrator.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object/administrator.php @@ -36,4 +36,28 @@ class Horde_Kolab_Server_Object_administrator extends Horde_Kolab_Server_Object_ * @var string */ protected $required_group = 'cn=admin,cn=internal'; + + /** + * Returns the server url of the given type for this user. + * + * This method is used to encapsulate multidomain support. + * + * @param string $server_type The type of server URL that should be returned. + * + * @return string The server url or empty on error. + */ + public function getServer($server_type) + { + global $conf; + + switch ($server_type) { + case 'homeserver': + default: + $server = $this->get(self::ATTRIBUTE_HOMESERVER); + if (empty($server)) { + $server = $_SERVER['SERVER_NAME']; + } + return $server; + } + } }