19declare(strict_types=1);
32 final public const string PREFIX =
'/backend';
50 $query =
'SELECT * FROM chatroom_admconfig';
51 $rset =
$DIC->database()->query($query);
52 $row =
$DIC->database()->fetchAssoc($rset);
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);
57 $settings =
new self();
58 if ($server_settings instanceof stdClass) {
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 ??
''));
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 ??
''));
99 if (!str_contains(
$url,
'://')) {
185 if (!str_contains(
$url,
'://')) {
Class ilChatroomServerSettings.
setClientUrlEnabled(bool $clientUrlEnabled)
setProtocol(string $protocol)
setAuthSecret(string $authSecret)
setDomain(string $domain)
setInstance(string $instance)
setAuthKey(string $authKey)
setSubDirectory(string $subDirectory)
final const string PREFIX
getBaseURL()
Creates base URL by calling $this->getProtocol(), $this->getDomain() and $this->getPort() and returne...
setClientUrl(string $clientUrl)
getURL(string $action, $scope=null)
Creates URL by calling $this->getBaseURL and using given $action and $scope and returns it.
setIliasUrl(string $iliasUrl)
const string DEFAULT_HOST
setIliasUrlEnabled(bool $iliasUrlEnabled)
const string DEFAULT_PROCOTOL