ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilChatroomServerSettings Class Reference

Class ilChatroomServerSettings. More...

+ Collaboration diagram for ilChatroomServerSettings:

Public Member Functions

 getURL (string $action, $scope=null)
 Creates URL by calling $this->getBaseURL and using given $action and $scope and returns it. More...
 
 generateIliasUrl ()
 
 getIliasUrlEnabled ()
 
 setIliasUrlEnabled (bool $iliasUrlEnabled)
 
 getProtocol ()
 
 setProtocol (string $protocol)
 
 getIliasUrl ()
 
 setIliasUrl (string $iliasUrl)
 
 getBaseURL ()
 Creates base URL by calling $this->getProtocol(), $this->getDomain() and $this->getPort() and returnes it. More...
 
 getDomain ()
 
 setDomain (string $domain)
 
 getPort ()
 
 setPort (int $port)
 
 getInstance ()
 
 setInstance (string $instance)
 
 generateClientUrl ()
 
 getClientUrlEnabled ()
 
 setClientUrlEnabled (bool $clientUrlEnabled)
 
 getClientUrl ()
 
 setClientUrl (string $clientUrl)
 
 getAuthKey ()
 
 setAuthKey (string $authKey)
 
 getAuthSecret ()
 
 setAuthSecret (string $authSecret)
 
 getSubDirectory ()
 
 setSubDirectory (string $subDirectory)
 

Static Public Member Functions

static loadDefault ()
 

Data Fields

final const string PREFIX = '/backend'
 

Private Attributes

const int DEFAULT_PORT = 8585
 
const string DEFAULT_PROCOTOL = 'http://'
 
const string DEFAULT_HOST = '192.168.1.94'
 
int $port = self::DEFAULT_PORT
 
string $protocol = self::DEFAULT_PROCOTOL
 
string $domain = self::DEFAULT_HOST
 
string $instance = '123456'
 
string $authKey = ''
 
string $authSecret = ''
 
bool $clientUrlEnabled = false
 
string $clientUrl = ''
 
bool $iliasUrlEnabled = false
 
string $iliasUrl = ''
 
string $subDirectory = ''
 

Detailed Description

Class ilChatroomServerSettings.

Author
Andreas Kordosz akord.nosp@m.osz@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$ \

Definition at line 27 of file class.ilChatroomServerSettings.php.

Member Function Documentation

◆ generateClientUrl()

ilChatroomServerSettings::generateClientUrl ( )

Definition at line 180 of file class.ilChatroomServerSettings.php.

180 : string
181 {
182 if ($this->getClientUrlEnabled()) {
183 $url = $this->getClientUrl();
184
185 if (!str_contains($url, '://')) {
186 $url = $this->getProtocol() . $url;
187 }
188
189 return $url;
190 }
191 return $this->getBaseURL();
192 }
getBaseURL()
Creates base URL by calling $this->getProtocol(), $this->getDomain() and $this->getPort() and returne...
$url
Definition: shib_logout.php:68

References $url, getBaseURL(), getClientUrl(), getClientUrlEnabled(), and getProtocol().

+ Here is the call graph for this function:

◆ generateIliasUrl()

ilChatroomServerSettings::generateIliasUrl ( )

Definition at line 94 of file class.ilChatroomServerSettings.php.

94 : string
95 {
96 if ($this->getIliasUrlEnabled()) {
97 $url = $this->getIliasUrl();
98
99 if (!str_contains($url, '://')) {
100 $url = $this->getProtocol() . $url;
101 }
102
103 return $url;
104 }
105
106 return $this->getBaseURL();
107 }

References $url, getBaseURL(), getIliasUrl(), getIliasUrlEnabled(), and getProtocol().

Referenced by getURL().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAuthKey()

ilChatroomServerSettings::getAuthKey ( )

Definition at line 214 of file class.ilChatroomServerSettings.php.

214 : string
215 {
216 return $this->authKey;
217 }

References $authKey.

◆ getAuthSecret()

ilChatroomServerSettings::getAuthSecret ( )

Definition at line 224 of file class.ilChatroomServerSettings.php.

224 : string
225 {
226 return $this->authSecret;
227 }

References $authSecret.

◆ getBaseURL()

ilChatroomServerSettings::getBaseURL ( )

Creates base URL by calling $this->getProtocol(), $this->getDomain() and $this->getPort() and returnes it.

Definition at line 145 of file class.ilChatroomServerSettings.php.

145 : string
146 {
147 return $this->getProtocol() . $this->getDomain() . ':' . $this->getPort();
148 }

References getDomain(), getPort(), and getProtocol().

Referenced by generateClientUrl(), and generateIliasUrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getClientUrl()

ilChatroomServerSettings::getClientUrl ( )

Definition at line 204 of file class.ilChatroomServerSettings.php.

204 : string
205 {
206 return $this->clientUrl;
207 }

References $clientUrl.

Referenced by generateClientUrl().

+ Here is the caller graph for this function:

◆ getClientUrlEnabled()

ilChatroomServerSettings::getClientUrlEnabled ( )

Definition at line 194 of file class.ilChatroomServerSettings.php.

194 : bool
195 {
197 }

References $clientUrlEnabled.

Referenced by generateClientUrl().

+ Here is the caller graph for this function:

◆ getDomain()

ilChatroomServerSettings::getDomain ( )

Definition at line 150 of file class.ilChatroomServerSettings.php.

150 : string
151 {
152 return $this->domain;
153 }

References $domain.

Referenced by getBaseURL().

+ Here is the caller graph for this function:

◆ getIliasUrl()

ilChatroomServerSettings::getIliasUrl ( )

Definition at line 131 of file class.ilChatroomServerSettings.php.

131 : string
132 {
133 return $this->iliasUrl;
134 }

References $iliasUrl.

Referenced by generateIliasUrl().

+ Here is the caller graph for this function:

◆ getIliasUrlEnabled()

ilChatroomServerSettings::getIliasUrlEnabled ( )

Definition at line 109 of file class.ilChatroomServerSettings.php.

109 : bool
110 {
112 }

References $iliasUrlEnabled.

Referenced by generateIliasUrl().

+ Here is the caller graph for this function:

◆ getInstance()

ilChatroomServerSettings::getInstance ( )

Definition at line 170 of file class.ilChatroomServerSettings.php.

170 : string
171 {
172 return $this->instance;
173 }

References $instance.

Referenced by getURL().

+ Here is the caller graph for this function:

◆ getPort()

ilChatroomServerSettings::getPort ( )

Definition at line 160 of file class.ilChatroomServerSettings.php.

160 : int
161 {
162 return $this->port;
163 }

References $port.

Referenced by getBaseURL().

+ Here is the caller graph for this function:

◆ getProtocol()

ilChatroomServerSettings::getProtocol ( )

Definition at line 119 of file class.ilChatroomServerSettings.php.

119 : string
120 {
121 return $this->protocol;
122 }

References $protocol.

Referenced by generateClientUrl(), generateIliasUrl(), and getBaseURL().

+ Here is the caller graph for this function:

◆ getSubDirectory()

ilChatroomServerSettings::getSubDirectory ( )

Definition at line 234 of file class.ilChatroomServerSettings.php.

234 : string
235 {
236 return $this->subDirectory;
237 }

References $subDirectory.

◆ getURL()

ilChatroomServerSettings::getURL ( string  $action,
  $scope = null 
)

Creates URL by calling $this->getBaseURL and using given $action and $scope and returns it.

Parameters
string | int | null$scope

Definition at line 83 of file class.ilChatroomServerSettings.php.

83 : string
84 {
85 $url = $this->generateIliasUrl() . self::PREFIX . '/' . $action . '/' . $this->getInstance();
86
87 if ($scope !== null) {
88 $url .= '/' . $scope;
89 }
90
91 return $url;
92 }
$scope
Definition: ltiregstart.php:51

References $scope, $url, generateIliasUrl(), and getInstance().

+ Here is the call graph for this function:

◆ loadDefault()

static ilChatroomServerSettings::loadDefault ( )
static

Definition at line 46 of file class.ilChatroomServerSettings.php.

46 : self
47 {
48 global $DIC;
49
50 $query = 'SELECT * FROM chatroom_admconfig';
51 $rset = $DIC->database()->query($query);
52 $row = $DIC->database()->fetchAssoc($rset);
53
54 $client_settings = json_decode($row['client_settings'], false, 512, JSON_THROW_ON_ERROR);
55 $server_settings = json_decode($row['server_settings'], false, 512, JSON_THROW_ON_ERROR);
56
57 $settings = new self();
58 if ($server_settings instanceof stdClass) {
59 $settings->setPort((int) ($server_settings->port ?? self::DEFAULT_PORT));
60 $settings->setProtocol((string) ($server_settings->protocol ?? self::DEFAULT_PROCOTOL));
61 $settings->setDomain((string) ($server_settings->address ?? self::DEFAULT_HOST));
62 $settings->setClientUrlEnabled((bool) ($server_settings->client_proxy ?? false));
63 $settings->setIliasUrlEnabled((bool) ($server_settings->ilias_proxy ?? false));
64 $settings->setClientUrl((string) ($server_settings->client_url ?? ''));
65 $settings->setIliasUrl((string) ($server_settings->ilias_url ?? ''));
66 $settings->setSubDirectory((string) ($server_settings->sub_directory ?? ''));
67 }
68
69 if ($client_settings instanceof stdClass) {
70 $settings->setInstance((string) ($client_settings->name ?? ''));
71 $settings->setAuthKey((string) ($client_settings->auth->key ?? ''));
72 $settings->setAuthSecret((string) ($client_settings->auth->secret ?? ''));
73 }
74
75 return $settings;
76 }
global $DIC
Definition: shib_login.php:26

References $DIC, DEFAULT_HOST, DEFAULT_PORT, and DEFAULT_PROCOTOL.

Referenced by ilObjChatroomAdminGUI\getConnector(), ilChatroomAdmin\getServerSettings(), and ilOnScreenChatGUI\initializeFrontend().

+ Here is the caller graph for this function:

◆ setAuthKey()

ilChatroomServerSettings::setAuthKey ( string  $authKey)

Definition at line 219 of file class.ilChatroomServerSettings.php.

219 : void
220 {
221 $this->authKey = $authKey;
222 }

References $authKey.

◆ setAuthSecret()

ilChatroomServerSettings::setAuthSecret ( string  $authSecret)

Definition at line 229 of file class.ilChatroomServerSettings.php.

229 : void
230 {
231 $this->authSecret = $authSecret;
232 }

References $authSecret.

◆ setClientUrl()

ilChatroomServerSettings::setClientUrl ( string  $clientUrl)

Definition at line 209 of file class.ilChatroomServerSettings.php.

209 : void
210 {
211 $this->clientUrl = $clientUrl;
212 }

References $clientUrl.

◆ setClientUrlEnabled()

ilChatroomServerSettings::setClientUrlEnabled ( bool  $clientUrlEnabled)

Definition at line 199 of file class.ilChatroomServerSettings.php.

199 : void
200 {
201 $this->clientUrlEnabled = $clientUrlEnabled;
202 }

References $clientUrlEnabled.

◆ setDomain()

ilChatroomServerSettings::setDomain ( string  $domain)

Definition at line 155 of file class.ilChatroomServerSettings.php.

155 : void
156 {
157 $this->domain = $domain;
158 }

References $domain.

◆ setIliasUrl()

ilChatroomServerSettings::setIliasUrl ( string  $iliasUrl)

Definition at line 136 of file class.ilChatroomServerSettings.php.

136 : void
137 {
138 $this->iliasUrl = $iliasUrl;
139 }

References $iliasUrl.

◆ setIliasUrlEnabled()

ilChatroomServerSettings::setIliasUrlEnabled ( bool  $iliasUrlEnabled)

Definition at line 114 of file class.ilChatroomServerSettings.php.

114 : void
115 {
116 $this->iliasUrlEnabled = $iliasUrlEnabled;
117 }

References $iliasUrlEnabled.

◆ setInstance()

ilChatroomServerSettings::setInstance ( string  $instance)

Definition at line 175 of file class.ilChatroomServerSettings.php.

175 : void
176 {
177 $this->instance = $instance;
178 }

References $instance.

◆ setPort()

ilChatroomServerSettings::setPort ( int  $port)

Definition at line 165 of file class.ilChatroomServerSettings.php.

165 : void
166 {
167 $this->port = $port;
168 }

References $port.

◆ setProtocol()

ilChatroomServerSettings::setProtocol ( string  $protocol)

Definition at line 124 of file class.ilChatroomServerSettings.php.

124 : void
125 {
126 if (!str_contains($protocol, '://')) {
127 $this->protocol = $protocol . '://';
128 }
129 }

References $protocol.

◆ setSubDirectory()

ilChatroomServerSettings::setSubDirectory ( string  $subDirectory)

Definition at line 239 of file class.ilChatroomServerSettings.php.

239 : void
240 {
241 $this->subDirectory = $subDirectory;
242 }

References $subDirectory.

Field Documentation

◆ $authKey

string ilChatroomServerSettings::$authKey = ''
private

Definition at line 38 of file class.ilChatroomServerSettings.php.

Referenced by getAuthKey(), and setAuthKey().

◆ $authSecret

string ilChatroomServerSettings::$authSecret = ''
private

Definition at line 39 of file class.ilChatroomServerSettings.php.

Referenced by getAuthSecret(), and setAuthSecret().

◆ $clientUrl

string ilChatroomServerSettings::$clientUrl = ''
private

Definition at line 41 of file class.ilChatroomServerSettings.php.

Referenced by getClientUrl(), and setClientUrl().

◆ $clientUrlEnabled

bool ilChatroomServerSettings::$clientUrlEnabled = false
private

Definition at line 40 of file class.ilChatroomServerSettings.php.

Referenced by getClientUrlEnabled(), and setClientUrlEnabled().

◆ $domain

string ilChatroomServerSettings::$domain = self::DEFAULT_HOST
private

Definition at line 36 of file class.ilChatroomServerSettings.php.

Referenced by getDomain(), and setDomain().

◆ $iliasUrl

string ilChatroomServerSettings::$iliasUrl = ''
private

Definition at line 43 of file class.ilChatroomServerSettings.php.

Referenced by getIliasUrl(), and setIliasUrl().

◆ $iliasUrlEnabled

bool ilChatroomServerSettings::$iliasUrlEnabled = false
private

Definition at line 42 of file class.ilChatroomServerSettings.php.

Referenced by getIliasUrlEnabled(), and setIliasUrlEnabled().

◆ $instance

string ilChatroomServerSettings::$instance = '123456'
private

Definition at line 37 of file class.ilChatroomServerSettings.php.

Referenced by getInstance(), and setInstance().

◆ $port

int ilChatroomServerSettings::$port = self::DEFAULT_PORT
private

Definition at line 34 of file class.ilChatroomServerSettings.php.

Referenced by getPort(), and setPort().

◆ $protocol

string ilChatroomServerSettings::$protocol = self::DEFAULT_PROCOTOL
private

Definition at line 35 of file class.ilChatroomServerSettings.php.

Referenced by getProtocol(), and setProtocol().

◆ $subDirectory

string ilChatroomServerSettings::$subDirectory = ''
private

Definition at line 44 of file class.ilChatroomServerSettings.php.

Referenced by getSubDirectory(), and setSubDirectory().

◆ DEFAULT_HOST

const string ilChatroomServerSettings::DEFAULT_HOST = '192.168.1.94'
private

Definition at line 31 of file class.ilChatroomServerSettings.php.

Referenced by loadDefault().

◆ DEFAULT_PORT

const int ilChatroomServerSettings::DEFAULT_PORT = 8585
private

Definition at line 29 of file class.ilChatroomServerSettings.php.

Referenced by loadDefault().

◆ DEFAULT_PROCOTOL

const string ilChatroomServerSettings::DEFAULT_PROCOTOL = 'http://'
private

Definition at line 30 of file class.ilChatroomServerSettings.php.

Referenced by loadDefault().

◆ PREFIX

final const string ilChatroomServerSettings::PREFIX = '/backend'

The documentation for this class was generated from the following file: