19 declare(strict_types=1);
34 private int $port = self::DEFAULT_PORT;
36 private string $domain = self::DEFAULT_HOST;
51 $query =
'SELECT * FROM chatroom_admconfig';
52 $rset = $DIC->database()->query(
$query);
53 $row = $DIC->database()->fetchAssoc($rset);
55 $client_settings = json_decode($row[
'client_settings'],
false, 512, JSON_THROW_ON_ERROR);
56 $server_settings = json_decode($row[
'server_settings'],
false, 512, JSON_THROW_ON_ERROR);
59 if ($server_settings instanceof
stdClass) {
60 $settings->setPort((
int) ($server_settings->port ?? self::DEFAULT_PORT));
61 $settings->setProtocol((
string) ($server_settings->protocol ?? self::DEFAULT_PROCOTOL));
62 $settings->setDomain((
string) ($server_settings->address ?? self::DEFAULT_HOST));
63 $settings->setSmiliesEnabled((
bool) ($client_settings->enable_smilies ??
false));
64 $settings->setClientUrlEnabled((
bool) ($server_settings->client_proxy ??
false));
65 $settings->setIliasUrlEnabled((
bool) ($server_settings->ilias_proxy ??
false));
66 $settings->setClientUrl((
string) ($server_settings->client_url ??
''));
67 $settings->setIliasUrl((
string) ($server_settings->ilias_url ??
''));
68 $settings->setSubDirectory((
string) ($server_settings->sub_directory ??
''));
71 if ($client_settings instanceof stdClass) {
72 $settings->setInstance((
string) ($client_settings->name ??
''));
73 $settings->setAuthKey((
string) ($client_settings->auth->key ??
''));
74 $settings->setAuthSecret((
string) ($client_settings->auth->secret ??
''));
103 if (strpos(
$url,
'://') ===
false) {
130 if (strpos($protocol,
'://') ===
false) {
131 $this->protocol = $protocol .
'://';
190 if (strpos(
$url,
'://') ===
false) {
226 $this->smilies_enabled = $a_bool;
setSmiliesEnabled(bool $a_bool)
setSubDirectory(string $subDirectory)
getURL(string $action, $scope=null)
Creates URL by calling $this->getBaseURL and using given $action and $scope and returns it...
setAuthKey(string $authKey)
setIliasUrl(string $iliasUrl)
setClientUrl(string $clientUrl)
setProtocol(string $protocol)
setAuthSecret(string $authSecret)
setClientUrlEnabled(bool $clientUrlEnabled)
setIliasUrlEnabled(bool $iliasUrlEnabled)
setDomain(string $domain)
getBaseURL()
Creates base URL by calling $this->getProtocol(), $this->getDomain() and $this->getPort() and returne...
Class ilChatroomServerSettings.
setInstance(string $instance)