ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilChatroomBanGUI Class Reference

Class ilChatroomBanGUI. More...

+ Inheritance diagram for ilChatroomBanGUI:
+ Collaboration diagram for ilChatroomBanGUI:

Public Member Functions

 executeDefault ($method)
 {} More...
 
 active ()
 Kicks and bans user, fetched from $_REQUEST['user'] and adds history entry. More...
 
- Public Member Functions inherited from ilChatroomGUIHandler
 __construct (ilChatroomObjectGUI $gui)
 
 sendResponse ($response)
 Sends a json encoded response and exits the php process. More...
 
 hasPermission ($permission)
 Checks for access with ilRbacSystem. More...
 
 execute ($method)
 Executes given $method if existing, otherwise executes executeDefault() method. More...
 
 executeDefault ($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...
 

Additional Inherited Members

- Protected Member Functions inherited from ilChatroomGUIHandler
 getRoomByObjectId ($objectId)
 
 exitIfNoRoomExists ($room)
 Checks if a ilChatroom exists. More...
 
 exitIfNoRoomPermission ($room, $subRoom, $chat_user)
 Check if user can moderate a chatroom. More...
 
 canModerate ($room, $subRoom, $user_id)
 Checks if the user has permission to moderate a ilChatroom. More...
 
 isMainRoom ($subRoomId)
 
- Protected Attributes inherited from ilChatroomGUIHandler
 $gui
 
 $ilUser
 
 $ilCtrl
 
 $ilLng
 
 $rbacsystem
 

Detailed Description

Class ilChatroomBanGUI.

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

Definition at line 13 of file class.ilChatroomBanGUI.php.

Member Function Documentation

◆ active()

ilChatroomBanGUI::active ( )

Kicks and bans user, fetched from $_REQUEST['user'] and adds history entry.

Definition at line 82 of file class.ilChatroomBanGUI.php.

References array, ilChatroom\byObjectId(), ilChatroomGUIHandler\exitIfNoRoomExists(), ilChatroomGUIHandler\isSuccessful(), ilChatroomGUIHandler\redirectIfNoPermission(), and ilChatroomGUIHandler\sendResponse().

83  {
84  $this->redirectIfNoPermission(array('read', 'moderate'));
85 
86  $room = ilChatroom::byObjectId($this->gui->object->getId());
87  $subRoomId = $_REQUEST['sub'];
88  $userToBan = $_REQUEST['user'];
89 
90  $this->exitIfNoRoomExists($room);
91 
92  $connector = $this->gui->getConnector();
93  $response = $connector->sendBan($room->getRoomId(), $subRoomId, $userToBan); // @TODO Respect Scope
94 
95  if($this->isSuccessful($response))
96  {
97  $room->banUser($_REQUEST['user']);
98  $room->disconnectUser($_REQUEST['user']);
99  }
100 
101  $this->sendResponse($response);
102  }
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.
isSuccessful($response)
Checks for success param in an json decoded response.
Create styles array
The data for the language used.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
+ Here is the call graph for this function:

◆ executeDefault()

ilChatroomBanGUI::executeDefault (   $method)

{}

Definition at line 43 of file class.ilChatroomBanGUI.php.

References ilChatroomGUIHandler\$ilCtrl, ilChatroom\byObjectId(), and ilChatroom\checkUserPermissions().

44  {
45  $this->show();
46  }
+ Here is the call graph for this function:

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