ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilChatroomInviteUsersToPrivateRoomGUI Class Reference

Class ilChatroomInviteUsersToPrivateRoomGUI. More...

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

Public Member Functions

 executeDefault ($method)
 
 byLogin ()
 
 byId ()
 
 getUserList ()
 
- 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...
 

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

Detailed Description

Member Function Documentation

◆ byId()

ilChatroomInviteUsersToPrivateRoomGUI::byId ( )

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

References inviteById().

63  {
64  $this->inviteById($_REQUEST['user']);
65  }
+ Here is the call graph for this function:

◆ byLogin()

ilChatroomInviteUsersToPrivateRoomGUI::byLogin ( )

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

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

Referenced by executeDefault().

29  {
30  $this->inviteById(ilObjUser::_lookupId($_REQUEST['user']));
31  }
static _lookupId($a_user_str)
Lookup id by login.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeDefault()

ilChatroomInviteUsersToPrivateRoomGUI::executeDefault (   $method)
Parameters
string$method
Returns
mixed

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

References byLogin().

+ Here is the call graph for this function:

◆ getUserList()

ilChatroomInviteUsersToPrivateRoomGUI::getUserList ( )

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

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

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

◆ inviteById()

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

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

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

Referenced by byId(), and byLogin().

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