38 if ($use_cache && self::$connection_status !== null) {
39 return self::$connection_status;
42 require_once
'Modules/Chatroom/classes/class.ilChatroomAdmin.php';
44 self::$connection_status = (bool) $connector->isServerAlive();
46 return self::$connection_status;
55 $this->
settings->getURL(
'Heartbeat'),
68 return $responseObject->status == 200;
81 $this->
settings->getURL(
'Connect', $scope) .
'/' . $userId
92 $credentials = $this->
settings->getAuthKey() .
':' . $this->
settings->getAuthSecret();
94 "Connection: close\r\n" .
95 "Content-Type: application/json; charset=utf-8\r\n" .
96 "Authorization: Basic " . base64_encode($credentials);
109 if (is_array($stream_context_params)) {
110 $ctx = array_merge_recursive($ctx, $stream_context_params);
113 set_error_handler(
function ($severity,
$message, $file, $line) {
119 restore_error_handler();
122 restore_error_handler();
138 $this->
settings->getURL(
'CreatePrivateRoom', $scope) .
'/' . $subScope .
'/' .
$user .
'/' . rawurlencode(
$title)
151 $this->
settings->getURL(
'DeletePrivateRoom', $scope) .
'/' . $subScope .
'/' .
$user 176 $this->
settings->getURL(
'EnterPrivateRoom', $scope) .
'/' . $subScope .
'/' .
$user 189 $this->
settings->getURL(
'ClearMessages', $scope) .
'/' . $subScope .
'/' .
$user 214 $this->
settings->getURL(
'LeavePrivateRoom', $scope) .
'/' . $subScope .
'/' .
$user 226 return $this->
kick($scope, $subScope,
$user);
240 $this->
settings->getURL(
'Kick', $scope) .
'/' . $subScope .
'/' .
$user 253 $this->
settings->getURL(
'Ban', $scope) .
'/' . $subScope .
'/' .
$user 306 $this->
settings->getURL(
'InvitePrivateRoom', $scope) .
'/' . $subScope .
'/' .
$user .
'/' . $invited_id
317 if ($pRoomId != null) {
318 $roomId .=
'-' . $pRoomId;
sendLeavePrivateRoom($scope, $subScope, $user)
sendDeletePrivateRoom($scope, $subScope, $user)
static getDefaultConfiguration()
Instantiates and returns ilChatroomAdmin object using instance_id and settings from settingsTable...
__construct(ilChatroomServerSettings $settings)
Constructor Sets $this->settings using given $settings.
post($scope, $query)
Returns post URL Creates post URL using given $scope and $query and returns it.
sendClearMessages($scope, $subScope, $user)
enterPrivateRoom($scope, $subScope, $user)
sendMessage($scope, $message, $options=array())
Returns if given message is sucessfully sent.
sendBan($scope, $subScope, $user)
catch(Exception $e) $message
kick($scope, $subScope, $user)
Returns kick URL Creates kick URL using given $scope and $query and returns it.
sendEnterPrivateRoom($scope, $subScope, $user)
connect($scope, $userId)
Returns connect URL Creates connect URL using given $scope and $userId and returns it...
static checkServerConnection($use_cache=true)
Class ilChatroomServerConnector.
file_get_contents($url, array $stream_context_params=null)
sendKick($scope, $subScope, $user)
static $connection_status
Class ilChatroomServerSettings.
createUniqueScopeId($roomId, $pRoomId=null)
leavePrivateRoom($scope, $subScope, $user)
sendInviteToPrivateRoom($scope, $subScope, $user, $invited_id)
sendCreatePrivateRoom($scope, $subScope, $user, $title)
static getLogger($a_component_id)
Get component logger.
getSettings()
Returns $this->settings.
sendUserConfigChange($message)