ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilChatroomKickGUI Class Reference

Class ilChatroomKickGUI. More...

+ Inheritance diagram for ilChatroomKickGUI:
+ Collaboration diagram for ilChatroomKickGUI:

Public Member Functions

 executeDefault (string $requestedMethod)
 
 main ()
 
- Public Member Functions inherited from ilChatroomGUIHandler
 execute (string $method)
 
 executeDefault (string $requestedMethod)
 
 redirectIfNoPermission ($permission)
 Checks for requested permissions and redirects if the permission check failed. More...
 
 isSuccessful ($response)
 Checks for success param in an json decoded response. More...
 
 hasPermission (string $permission)
 

Private Member Functions

 buildMessage (string $messageString, ilChatroomUser $chat_user)
 

Additional Inherited Members

- Protected Member Functions inherited from ilChatroomGUIHandler
 getRequestValue (string $key, Transformation $trafo, $default=null)
 
 hasRequestValue (string $key)
 
 getRoomByObjectId (int $objectId)
 
 exitIfNoRoomExists (?ilChatroom $room)
 Checks if a ilChatroom exists. More...
 
 sendJSONResponse ($response)
 Sends a json encoded response and exits the php process. More...
 
 sendResponse (string $content, string $type)
 Sends a response and exits the php process. More...
 
- Protected Attributes inherited from ilChatroomGUIHandler
ilObjUser $ilUser
 
ilCtrlInterface $ilCtrl
 
ilLanguage $ilLng
 
Filesystem $webDirectory
 
ilObjectService $obj_service
 
FileUpload $upload
 
ilRbacSystem $rbacsystem
 
ilGlobalTemplateInterface $mainTpl
 
ILIAS $ilias
 
ilNavigationHistory $navigationHistory
 
ilTree $tree
 
ilTabsGUI $tabs
 
UIFactory $uiFactory
 
UIRenderer $uiRenderer
 
GlobalHttpState $http
 
Refinery $refinery
 

Detailed Description

Class ilChatroomKickGUI.

Author
Jan Posselt jposs.nosp@m.elt@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$ \

Definition at line 27 of file class.ilChatroomKickGUI.php.

Member Function Documentation

◆ buildMessage()

ilChatroomKickGUI::buildMessage ( string  $messageString,
ilChatroomUser  $chat_user 
)
private

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

References $data.

29  : stdClass
30  {
31  $data = new stdClass();
32 
33  $data->user = $this->gui->getObject()->getPersonalInformation($chat_user);
34  $data->userToKick = $messageString;
35  $data->timestamp = date('c');
36  $data->type = 'kick';
37 
38  return $data;
39  }

◆ executeDefault()

ilChatroomKickGUI::executeDefault ( string  $requestedMethod)

Definition at line 41 of file class.ilChatroomKickGUI.php.

References main().

41  : void
42  {
43  $this->main();
44  }
+ Here is the call graph for this function:

◆ main()

ilChatroomKickGUI::main ( )

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

References $response, ilChatroom\byObjectId(), ilChatroomGUIHandler\exitIfNoRoomExists(), ilChatroomGUIHandler\getRequestValue(), ilChatroomGUIHandler\isSuccessful(), ilChatroomGUIHandler\redirectIfNoPermission(), ILIAS\Repository\refinery(), and ilChatroomGUIHandler\sendResponse().

Referenced by executeDefault().

46  : void
47  {
48  $this->redirectIfNoPermission(['read', 'moderate']);
49 
50  $room = ilChatroom::byObjectId($this->gui->getObject()->getId());
51  $this->exitIfNoRoomExists($room);
52 
53  $userToKick = $this->getRequestValue('user', $this->refinery->kindlyTo()->int());
54 
55  $connector = $this->gui->getConnector();
56  $response = $connector->sendKick($room->getRoomId(), $userToKick);
57 
58  if ($this->isSuccessful($response)) {
59  // 2013-09-11: Should already been done by the chat server
60  $room->disconnectUser($userToKick);
61  }
62 
63  $this->sendResponse($response, 'application/json');
64  }
redirectIfNoPermission($permission)
Checks for requested permissions and redirects if the permission check failed.
getRequestValue(string $key, Transformation $trafo, $default=null)
$response
Definition: xapitoken.php:93
exitIfNoRoomExists(?ilChatroom $room)
Checks if a ilChatroom exists.
sendResponse(string $content, string $type)
Sends a response and exits the php process.
isSuccessful($response)
Checks for success param in an json decoded response.
static byObjectId(int $object_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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