ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilChatroomServerSettings Class Reference

Class ilChatroomServerSettings. More...

+ Collaboration diagram for ilChatroomServerSettings:

Public Member Functions

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

Static Public Member Functions

static loadDefault ()
 

Data Fields

const PREFIX = '/backend'
 

Private Attributes

 $port = '8585'
 
 $protocol = 'http://'
 
 $domain = '192.168.1.94'
 
 $instance = '123456'
 
 $smilies_enabled = false
 
 $authKey
 
 $authSecret
 
 $clientUrlEnabled
 
 $clientUrl
 
 $iliasUrlEnabled
 
 $iliasUrl
 
 $subDirectory
 

Detailed Description

Member Function Documentation

◆ generateClientUrl()

ilChatroomServerSettings::generateClientUrl ( )
Returns
string

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

210 {
211 if ($this->getClientUrlEnabled()) {
212 $url = $this->getClientUrl();
213
214 if (strpos($url, '://') === false) {
215 $url = $this->getProtocol() . $url;
216 }
217
218 return $url;
219 }
220 return $this->getBaseURL();
221 }
getBaseURL()
Returns base URL Creates base URL by calling $this->getProtocol(), $this->getDomain() and $this->getP...
$url

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

+ Here is the call graph for this function:

◆ generateIliasUrl()

ilChatroomServerSettings::generateIliasUrl ( )
Returns
string

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

76 {
77 if ($this->getIliasUrlEnabled()) {
78 $url = $this->getIliasUrl();
79
80 if (strpos($url, '://') === false) {
81 $url = $this->getProtocol() . $url;
82 }
83
84 return $url;
85 }
86 return $this->getBaseURL();
87 }

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 ( )
Returns
string

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

References $authKey.

◆ getAuthSecret()

ilChatroomServerSettings::getAuthSecret ( )
Returns
string

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

References $authSecret.

◆ getBaseURL()

ilChatroomServerSettings::getBaseURL ( )

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

Returns
string

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

148 {
149 return $this->getProtocol() . $this->getDomain() . ':' . $this->getPort();
150 }

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 ( )
Returns
string

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

References $clientUrl.

Referenced by generateClientUrl().

+ Here is the caller graph for this function:

◆ getClientUrlEnabled()

ilChatroomServerSettings::getClientUrlEnabled ( )
Returns
bool

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

References $clientUrlEnabled.

Referenced by generateClientUrl().

+ Here is the caller graph for this function:

◆ getDomain()

ilChatroomServerSettings::getDomain ( )

Returns $this->domain.

Returns
string

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

References $domain.

Referenced by getBaseURL().

+ Here is the caller graph for this function:

◆ getIliasUrl()

ilChatroomServerSettings::getIliasUrl ( )
Returns
string

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

References $iliasUrl.

Referenced by generateIliasUrl().

+ Here is the caller graph for this function:

◆ getIliasUrlEnabled()

ilChatroomServerSettings::getIliasUrlEnabled ( )
Returns
bool

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

References $iliasUrlEnabled.

Referenced by generateIliasUrl().

+ Here is the caller graph for this function:

◆ getInstance()

ilChatroomServerSettings::getInstance ( )

Returns $this->instance.

Returns
string

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

References $instance.

Referenced by getURL().

+ Here is the caller graph for this function:

◆ getPort()

ilChatroomServerSettings::getPort ( )

Returns $this->port.

Returns
string

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

References $port.

Referenced by getBaseURL().

+ Here is the caller graph for this function:

◆ getProtocol()

ilChatroomServerSettings::getProtocol ( )

Returns $this->protocol.

Returns
string

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

References $protocol.

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

+ Here is the caller graph for this function:

◆ getSmiliesEnabled()

ilChatroomServerSettings::getSmiliesEnabled ( )
Returns
bool

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

References $smilies_enabled.

Referenced by ilOnScreenChatGUI\getEmoticons().

+ Here is the caller graph for this function:

◆ getSubDirectory()

ilChatroomServerSettings::getSubDirectory ( )
Returns
mixed

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

References $subDirectory.

◆ getURL()

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

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

Parameters
string$action
string | null$scope
Returns
string

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

62 {
63 $url = $this->generateIliasUrl() . self::PREFIX . '/' . $action . '/' . $this->getInstance();
64
65 if ($scope !== null) {
66 $url .= '/' . $scope;
67 }
68
69 return $url;
70 }
$action

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

+ Here is the call graph for this function:

◆ loadDefault()

static ilChatroomServerSettings::loadDefault ( )
static

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

27 {
28 global $DIC;
29
30 $query = 'SELECT * FROM chatroom_admconfig';
31 $rset = $DIC->database()->query($query);
32 $row = $DIC->database()->fetchAssoc($rset);
33
34 $client_settings = json_decode($row['client_settings']);
35 $server_settings = json_decode($row['server_settings']);
36
37 $settings = new ilChatroomServerSettings();
38 $settings->setPort($server_settings->port);
39 $settings->setProtocol($server_settings->protocol);
40 $settings->setInstance($client_settings->name);
41 $settings->setDomain($server_settings->address);
42 $settings->setSmiliesEnabled($client_settings->enable_smilies);
43 $settings->setAuthKey($client_settings->auth->key);
44 $settings->setAuthSecret($client_settings->auth->secret);
45 $settings->setClientUrlEnabled($server_settings->client_proxy);
46 $settings->setIliasUrlEnabled($server_settings->ilias_proxy);
47 $settings->setClientUrl($server_settings->client_url);
48 $settings->setIliasUrl($server_settings->ilias_url);
49 $settings->setSubDirectory($server_settings->sub_directory);
50
51 return $settings;
52 }
Class ilChatroomServerSettings.
$row
$query
global $DIC
Definition: saml.php:7

References $DIC, $query, and $row.

Referenced by ilChatroomBlockGUI\fillDataSection(), ilObjChatroomAdminGUI\getConnector(), ilChatroomAdmin\getServerSettings(), and ilOnScreenChatGUI\loadServerSettings().

+ Here is the caller graph for this function:

◆ setAuthKey()

ilChatroomServerSettings::setAuthKey (   $authKey)
Parameters
string$authKey

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

283 {
284 $this->authKey = $authKey;
285 }

References $authKey.

◆ setAuthSecret()

ilChatroomServerSettings::setAuthSecret (   $authSecret)
Parameters
string$authSecret

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

299 {
300 $this->authSecret = $authSecret;
301 }

References $authSecret.

◆ setClientUrl()

ilChatroomServerSettings::setClientUrl (   $clientUrl)
Parameters
string$clientUrl

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

251 {
252 $this->clientUrl = $clientUrl;
253 }

References $clientUrl.

◆ setClientUrlEnabled()

ilChatroomServerSettings::setClientUrlEnabled (   $clientUrlEnabled)
Parameters
bool$clientUrlEnabled

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

235 {
236 $this->clientUrlEnabled = $clientUrlEnabled;
237 }

References $clientUrlEnabled.

◆ setDomain()

ilChatroomServerSettings::setDomain (   $domain)

Sets $this->domain using given $domain.

Parameters
string$domain

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

166 {
167 $this->domain = $domain;
168 }

References $domain.

◆ setIliasUrl()

ilChatroomServerSettings::setIliasUrl (   $iliasUrl)
Parameters
string$iliasUrl

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

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

References $iliasUrl.

◆ setIliasUrlEnabled()

ilChatroomServerSettings::setIliasUrlEnabled (   $iliasUrlEnabled)
Parameters
bool$iliasUrlEnabled

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

101 {
102 $this->iliasUrlEnabled = $iliasUrlEnabled;
103 }

References $iliasUrlEnabled.

◆ setInstance()

ilChatroomServerSettings::setInstance (   $instance)

Sets $this->instance using given $instance.

Parameters
string$instance

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

202 {
203 $this->instance = $instance;
204 }
instance(Loop $newLoop=null)
Retrieves or sets the global Loop object.
Definition: functions.php:173

References $instance, and Sabre\Event\Loop\instance().

+ Here is the call graph for this function:

◆ setPort()

ilChatroomServerSettings::setPort (   $port)

Sets $this->port using given $port.

Parameters
string$port

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

184 {
185 $this->port = $port;
186 }

References $port.

◆ setProtocol()

ilChatroomServerSettings::setProtocol (   $protocol)

Sets $this->protocol using given $protocol.

Parameters
string$protocol

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

119 {
120 if (strpos($protocol, '://') === false) {
121 $this->protocol = $protocol . '://';
122 }
123 }

References $protocol.

◆ setSmiliesEnabled()

ilChatroomServerSettings::setSmiliesEnabled (   $a_bool)
Parameters
bool$a_bool

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

267 {
268 $this->smilies_enabled = $a_bool;
269 }

◆ setSubDirectory()

ilChatroomServerSettings::setSubDirectory (   $subDirectory)
Parameters
mixed$subDirectory

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

315 {
316 $this->subDirectory = $subDirectory;
317 }

References $subDirectory.

Field Documentation

◆ $authKey

ilChatroomServerSettings::$authKey
private

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

Referenced by getAuthKey(), and setAuthKey().

◆ $authSecret

ilChatroomServerSettings::$authSecret
private

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

Referenced by getAuthSecret(), and setAuthSecret().

◆ $clientUrl

ilChatroomServerSettings::$clientUrl
private

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

Referenced by getClientUrl(), and setClientUrl().

◆ $clientUrlEnabled

ilChatroomServerSettings::$clientUrlEnabled
private

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

Referenced by getClientUrlEnabled(), and setClientUrlEnabled().

◆ $domain

ilChatroomServerSettings::$domain = '192.168.1.94'
private

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

Referenced by getDomain(), and setDomain().

◆ $iliasUrl

ilChatroomServerSettings::$iliasUrl
private

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

Referenced by getIliasUrl(), and setIliasUrl().

◆ $iliasUrlEnabled

ilChatroomServerSettings::$iliasUrlEnabled
private

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

Referenced by getIliasUrlEnabled(), and setIliasUrlEnabled().

◆ $instance

ilChatroomServerSettings::$instance = '123456'
private

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

Referenced by getInstance(), and setInstance().

◆ $port

ilChatroomServerSettings::$port = '8585'
private

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

Referenced by getPort(), and setPort().

◆ $protocol

ilChatroomServerSettings::$protocol = 'http://'
private

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

Referenced by getProtocol(), and setProtocol().

◆ $smilies_enabled

ilChatroomServerSettings::$smilies_enabled = false
private

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

Referenced by getSmiliesEnabled().

◆ $subDirectory

ilChatroomServerSettings::$subDirectory
private

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

Referenced by getSubDirectory(), and setSubDirectory().

◆ PREFIX

const ilChatroomServerSettings::PREFIX = '/backend'

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