ILIAS  release_7 Revision v7.30-3-g800a261c036
ilChatroomInviteUsersToPrivateRoomGUI Class Reference

Class ilChatroomInviteUsersToPrivateRoomGUI. More...

+ Inheritance diagram for ilChatroomInviteUsersToPrivateRoomGUI:
+ Collaboration diagram for ilChatroomInviteUsersToPrivateRoomGUI:

Public Member Functions

 executeDefault ($requestedMethod)
 @inheritDoc More...
 
 byLogin ()
 
 byId ()
 
 getUserList ()
 
- Public Member Functions inherited from ilChatroomGUIHandler
 __construct (ilChatroomObjectGUI $gui)
 
 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...
 
 sendResponse ($response)
 Sends a json encoded response and exits the php process. More...
 
 hasPermission ($permission)
 Checks for access with ilRbacSystem. More...
 

Private Member Functions

 inviteById ($invited_id)
 

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
 
 $webDirectory
 
 $obj_service
 
 $upload
 
 $rbacsystem
 
 $mainTpl
 
 $ilias
 
 $navigationHistory
 
 $tree
 
 $tabs
 

Detailed Description

Member Function Documentation

◆ byId()

ilChatroomInviteUsersToPrivateRoomGUI::byId ( )

Definition at line 58 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

59 {
60 $this->inviteById($_REQUEST['user']);
61 }

References inviteById().

+ Here is the call graph for this function:

◆ byLogin()

ilChatroomInviteUsersToPrivateRoomGUI::byLogin ( )

Definition at line 24 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

25 {
26 $this->inviteById(ilObjUser::_lookupId($_REQUEST['user']));
27 }
static _lookupId($a_user_str)
Lookup id by login.

References ilObjUser\_lookupId(), and inviteById().

Referenced by executeDefault().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeDefault()

ilChatroomInviteUsersToPrivateRoomGUI::executeDefault (   $requestedMethod)

@inheritDoc

Reimplemented from ilChatroomGUIHandler.

Definition at line 19 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

References byLogin().

+ Here is the call graph for this function:

◆ getUserList()

ilChatroomInviteUsersToPrivateRoomGUI::getUserList ( )

Definition at line 66 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

67 {
68 require_once 'Services/User/classes/class.ilUserAutoComplete.php';
69 $auto = new ilUserAutoComplete();
70 $auto->setUser($this->ilUser);
72 if ($this->ilUser->isAnonymous()) {
73 $auto->setSearchType(ilUserAutoComplete::SEARCH_TYPE_EQUALS);
74 }
75
76 if (($_REQUEST['fetchall'])) {
77 $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
78 }
79 $auto->setMoreLinkAvailable(true);
80 $auto->setSearchFields(array('firstname', 'lastname'));
81 $auto->setResultField('login');
82 $auto->enableFieldSearchableCheck(true);
83 echo $auto->getList($_REQUEST['q']);
84 exit;
85 }
Auto completion class for user lists.
exit
Definition: login.php:29

References exit, ilUserAutoComplete\MAX_ENTRIES, ilUserAutoComplete\PRIVACY_MODE_RESPECT_USER_SETTING, and ilUserAutoComplete\SEARCH_TYPE_EQUALS.

◆ inviteById()

ilChatroomInviteUsersToPrivateRoomGUI::inviteById (   $invited_id)
private
Parameters
int$invited_id

Definition at line 32 of file class.ilChatroomInviteUsersToPrivateRoomGUI.php.

33 {
34 $this->redirectIfNoPermission('read');
35
36 $room = ilChatroom::byObjectId($this->gui->object->getId());
37 $subRoomId = (int) $_REQUEST['sub'];
38 $chat_user = new ilChatroomUser($this->ilUser, $room);
39
40 $this->exitIfNoRoomExists($room);
41 $this->exitIfNoRoomPermission($room, $subRoomId, $chat_user);
42
43 if (!$this->isMainRoom($subRoomId)) {
44 $room->inviteUserToPrivateRoom($invited_id, $subRoomId);
45 }
46
47 $connector = $this->gui->getConnector();
48 $response = $connector->sendInviteToPrivateRoom($room->getRoomId(), $subRoomId, $chat_user->getUserId(), $invited_id);
49
50 $room->sendInvitationNotification($this->gui, $chat_user, $invited_id, $subRoomId);
51
52 $this->sendResponse($response);
53 }
exitIfNoRoomPermission($room, $subRoom, $chat_user)
Check if user can moderate a chatroom.
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.
Class ilChatroomUser.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
$response

References $response, ilChatroom\byObjectId(), ilChatroomGUIHandler\exitIfNoRoomExists(), ilChatroomGUIHandler\exitIfNoRoomPermission(), ilChatroomGUIHandler\isMainRoom(), ilChatroomGUIHandler\redirectIfNoPermission(), and ilChatroomGUIHandler\sendResponse().

Referenced by byId(), and byLogin().

+ 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: