Add the getServer function for admins. This allows them to login too.
authorGunnar Wrobel <p@rdus.de>
Sun, 29 Mar 2009 21:08:06 +0000 (21:08 +0000)
committerGunnar Wrobel <p@rdus.de>
Sun, 29 Mar 2009 21:08:06 +0000 (21:08 +0000)
framework/Kolab_Server/lib/Horde/Kolab/Server/Object/administrator.php

index cb9ad69..ab7c20a 100644 (file)
@@ -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;
+        }
+    }
 }