ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilChatroomInviteUsersToPrivateRoomTask Class Reference

Class ilChatroomInviteUsersToPrivateRoomTask. More...

+ Inheritance diagram for ilChatroomInviteUsersToPrivateRoomTask:
+ Collaboration diagram for ilChatroomInviteUsersToPrivateRoomTask:

Public Member Functions

 __construct (ilDBayObjectGUI $gui)
 Constructor.
 executeDefault ($method)
 Prepares and posts message fetched from $_REQUEST['message'] to recipients fetched from $_REQUEST['recipient'] and adds an entry to history if successful.
 byLogin ()
 byId ()
- Public Member Functions inherited from ilDBayTaskHandler
 execute ($method)
 Executes given $method if existing, otherwise executes executeDefault() method.

Private Member Functions

 inviteById ($invited_id)

Private Attributes

 $gui

Detailed Description

Constructor & Destructor Documentation

ilChatroomInviteUsersToPrivateRoomTask::__construct ( ilDBayObjectGUI  $gui)

Constructor.

Sets $this->gui using given $gui

Parameters
ilDBayObjectGUI$gui

Reimplemented from ilDBayTaskHandler.

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

References $gui.

{
$this->gui = $gui;
}

Member Function Documentation

ilChatroomInviteUsersToPrivateRoomTask::byId ( )

Definition at line 50 of file class.ilChatroomInviteUsersToPrivateRoomTask.php.

References $_REQUEST, and inviteById().

{
$this->inviteById($_REQUEST['users']);
}

+ Here is the call graph for this function:

ilChatroomInviteUsersToPrivateRoomTask::byLogin ( )

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

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

Referenced by executeDefault().

{
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChatroomInviteUsersToPrivateRoomTask::executeDefault (   $method)

Prepares and posts message fetched from $_REQUEST['message'] to recipients fetched from $_REQUEST['recipient'] and adds an entry to history if successful.

ilTemplate $tpl ilObjUser $ilUser

Parameters
string$method

Reimplemented from ilDBayTaskHandler.

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

References byLogin().

{
$this->byLogin();
}

+ Here is the call graph for this function:

ilChatroomInviteUsersToPrivateRoomTask::inviteById (   $invited_id)
private

Definition at line 54 of file class.ilChatroomInviteUsersToPrivateRoomTask.php.

References $_REQUEST, $result, $tpl, ilChatroom\byObjectId(), ilChatroom\checkUserPermissions(), exit, and ilUtil\redirect().

Referenced by byId(), and byLogin().

{
global $tpl, $ilUser;
if ( !ilChatroom::checkUserPermissions( 'read', $this->gui->ref_id ) )
{
ilUtil::redirect("repository.php");
}
$room = ilChatroom::byObjectId( $this->gui->object->getId() );
$chat_user = new ilChatroomUser( $ilUser, $room );
$user_id = $chat_user->getUserId();
if( !$room )
{
$response = json_encode( array(
'success' => false,
'reason' => 'unkown room'
) );
echo json_encode( $response );
}
else if( $_REQUEST['sub'] && !$room->isOwnerOfPrivateRoom( $user_id, $_REQUEST['sub'] ) )
{
$response = json_encode( array(
'success' => false,
'reason' => 'not owner of private room'
) );
echo json_encode( $response );
}
$connector = $this->gui->getConnector();
//if ($_REQUEST['sub']) {
$result = $connector->inviteToPrivateRoom($room, $_REQUEST['sub'], $ilUser, $invited_id);
//}
$room->sendInvitationNotification($this->gui, $chat_user, $invited_id, (int)$_REQUEST['sub']);
echo json_encode($result);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilChatroomInviteUsersToPrivateRoomTask::$gui
private

Definition at line 18 of file class.ilChatroomInviteUsersToPrivateRoomTask.php.

Referenced by __construct().


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