ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 PREFIX = '/backend'
 

Private Attributes

const DEFAULT_PORT = 8585
 
const DEFAULT_PROCOTOL = 'http://'
 
const 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.

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

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  }
$url
Definition: shib_logout.php:66
getBaseURL()
Creates base URL by calling $this->getProtocol(), $this->getDomain() and $this->getPort() and returne...
+ Here is the call graph for this function:

◆ generateIliasUrl()

ilChatroomServerSettings::generateIliasUrl ( )

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

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

Referenced by getURL().

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  }
$url
Definition: shib_logout.php:66
getBaseURL()
Creates base URL by calling $this->getProtocol(), $this->getDomain() and $this->getPort() and returne...
+ 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.

References $authKey.

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

◆ getAuthSecret()

ilChatroomServerSettings::getAuthSecret ( )

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

References $authSecret.

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

◆ 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.

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.

References $clientUrl.

Referenced by generateClientUrl().

204  : string
205  {
206  return $this->clientUrl;
207  }
+ Here is the caller graph for this function:

◆ getClientUrlEnabled()

ilChatroomServerSettings::getClientUrlEnabled ( )

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

References $clientUrlEnabled.

Referenced by generateClientUrl().

194  : bool
195  {
197  }
+ Here is the caller graph for this function:

◆ getDomain()

ilChatroomServerSettings::getDomain ( )

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

References $domain.

Referenced by getBaseURL().

150  : string
151  {
152  return $this->domain;
153  }
+ Here is the caller graph for this function:

◆ getIliasUrl()

ilChatroomServerSettings::getIliasUrl ( )

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

References $iliasUrl.

Referenced by generateIliasUrl().

131  : string
132  {
133  return $this->iliasUrl;
134  }
+ Here is the caller graph for this function:

◆ getIliasUrlEnabled()

ilChatroomServerSettings::getIliasUrlEnabled ( )

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

References $iliasUrlEnabled.

Referenced by generateIliasUrl().

109  : bool
110  {
111  return $this->iliasUrlEnabled;
112  }
+ Here is the caller graph for this function:

◆ getInstance()

ilChatroomServerSettings::getInstance ( )

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

References $instance.

Referenced by getURL().

170  : string
171  {
172  return $this->instance;
173  }
+ Here is the caller graph for this function:

◆ getPort()

ilChatroomServerSettings::getPort ( )

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

References $port.

Referenced by getBaseURL().

160  : int
161  {
162  return $this->port;
163  }
+ Here is the caller graph for this function:

◆ getProtocol()

ilChatroomServerSettings::getProtocol ( )

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

References $protocol.

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

119  : string
120  {
121  return $this->protocol;
122  }
+ Here is the caller graph for this function:

◆ getSubDirectory()

ilChatroomServerSettings::getSubDirectory ( )

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

References $subDirectory.

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

◆ 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.

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

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:47
$url
Definition: shib_logout.php:66
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ loadDefault()

static ilChatroomServerSettings::loadDefault ( )
static

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

References $DIC.

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

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:22
+ Here is the caller graph for this function:

◆ setAuthKey()

ilChatroomServerSettings::setAuthKey ( string  $authKey)

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

References $authKey.

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

◆ setAuthSecret()

ilChatroomServerSettings::setAuthSecret ( string  $authSecret)

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

References $authSecret.

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

◆ setClientUrl()

ilChatroomServerSettings::setClientUrl ( string  $clientUrl)

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

References $clientUrl.

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

◆ setClientUrlEnabled()

ilChatroomServerSettings::setClientUrlEnabled ( bool  $clientUrlEnabled)

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

References $clientUrlEnabled.

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

◆ setDomain()

ilChatroomServerSettings::setDomain ( string  $domain)

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

References $domain.

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

◆ setIliasUrl()

ilChatroomServerSettings::setIliasUrl ( string  $iliasUrl)

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

References $iliasUrl.

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

◆ setIliasUrlEnabled()

ilChatroomServerSettings::setIliasUrlEnabled ( bool  $iliasUrlEnabled)

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

References $iliasUrlEnabled.

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

◆ setInstance()

ilChatroomServerSettings::setInstance ( string  $instance)

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

References $instance.

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

◆ setPort()

ilChatroomServerSettings::setPort ( int  $port)

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

References $port.

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

◆ 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  }

◆ setSubDirectory()

ilChatroomServerSettings::setSubDirectory ( string  $subDirectory)

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

References $subDirectory.

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

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().

◆ $subDirectory

string ilChatroomServerSettings::$subDirectory = ''
private

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

Referenced by getSubDirectory(), and setSubDirectory().

◆ DEFAULT_HOST

const ilChatroomServerSettings::DEFAULT_HOST = '192.168.1.94'
private

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

◆ DEFAULT_PORT

const ilChatroomServerSettings::DEFAULT_PORT = 8585
private

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

◆ DEFAULT_PROCOTOL

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

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

◆ PREFIX

final const ilChatroomServerSettings::PREFIX = '/backend'

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