4 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
5 require_once
'Modules/Chatroom/classes/class.ilChatroomUser.php';
30 $subRoomId = $room->addPrivateRoom(
$title, $chat_user, array(
'public' =>
false));
32 $connector = $this->gui->getConnector();
33 $response = $connector->sendCreatePrivateRoom($room->getRoomId(), $subRoomId, $chat_user->getUserId(),
$title);
39 'owner' => $chat_user->getUserId(),
40 'subRoomId' => $subRoomId
53 if (!$room->isSubscribed($chat_user->getUserId())) {
56 'reason' =>
'not subscribed' 61 public function delete()
64 $subRoom = $_REQUEST[
'sub'];
70 $room->closePrivateRoom($subRoom);
72 $connector = $this->gui->getConnector();
73 $response = $connector->sendDeletePrivateRoom($room->getRoomId(), $subRoom, $chat_user->getUserId());
82 $subRoom = $_REQUEST[
'sub'];
87 $connector = $this->gui->getConnector();
88 $response = $connector->sendLeavePrivateRoom($room->getRoomId(), $subRoom, $chat_user->getUserId());
90 if ($room->userIsInPrivateRoom($subRoom, $chat_user->getUserId())) {
91 $room->unsubscribeUserFromPrivateRoom($subRoom, $chat_user->getUserId());
102 $subRoom = $_REQUEST[
'sub'];
108 $connector = $this->gui->getConnector();
109 $response = $connector->sendEnterPrivateRoom($room->getRoomId(), $subRoom, $chat_user->getUserId());
112 $room->subscribeUserToPrivateRoom($subRoom, $chat_user->getUserId());
125 if (!$room->isAllowedToEnterPrivateRoom($chat_user->getUserId(), $subRoom)) {
128 'reason' =>
'not allowed enter to private room' 137 $response = $room->listUsersInPrivateRoom($_REQUEST[
'sub']);
Class ilChatroomPrivateRoomGUI.
redirectIfNoPermission($permission)
Checks for requested permissions and redirects if the permission check failed.
sendResponse($response)
Sends a json encoded response and exits the php process.
exitIfNoRoomExists($room)
Checks if a ilChatroom exists.
exitIfEnterRoomIsNotAllowed($room, $subRoom, $chat_user)
Class ilChatroomGUIHandler.
exitIfNoRoomSubscription($room, $chat_user)
isSuccessful($response)
Checks for success param in an json decoded response.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.