1: <?php
2: /**
3: * A system administrator.
4: *
5: * PHP version 5
6: *
7: * @category Kolab
8: * @package Kolab_Server
9: * @author Gunnar Wrobel <wrobel@pardus.de>
10: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
11: * @link http://pear.horde.org/index.php?package=Kolab_Server
12: */
13:
14: /**
15: * This class provides methods to deal with administrator
16: * entries for Kolab.
17: *
18: * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
19: *
20: * See the enclosed file COPYING for license information (LGPL). If you
21: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
22: *
23: * @category Kolab
24: * @package Kolab_Server
25: * @author Gunnar Wrobel <wrobel@pardus.de>
26: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
27: * @link http://pear.horde.org/index.php?package=Kolab_Server
28: */
29: class Horde_Kolab_Server_Object_Kolab_Administrator extends Horde_Kolab_Server_Object_Kolab_Adminrole
30: {
31:
32: /**
33: * The group the UID must be member of so that this object really
34: * matches this class type. This may not include the root UID.
35: *
36: * @var string
37: */
38: /* public $required_group = array(self::ATTRIBUTE_CN => 'admin', */
39: /* Horde_Kolab_Server_Object_Kolabgroupofnames::ATTRIBUTE_VISIBILITY => false); */
40:
41: /**
42: * Returns the server url of the given type for this user.
43: *
44: * This method is used to encapsulate multidomain support.
45: *
46: * @param string $server_type The type of server URL that should be returned.
47: *
48: * @return string The server url or empty on error.
49: */
50: public function getServer($server_type)
51: {
52: global $conf;
53:
54: switch ($server_type) {
55: case 'homeserver':
56: default:
57: $server = $this->get(self::ATTRIBUTE_HOMESERVER);
58: if (empty($server)) {
59: $server = $_SERVER['SERVER_NAME'];
60: }
61: return $server;
62: }
63: }
64: }
65: