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

Adds link to mail. More...

+ Inheritance diagram for ilMailUserActionProvider:
+ Collaboration diagram for ilMailUserActionProvider:

Public Member Functions

 checkUserMailAccess ($a_user_id)
 Check user chat access. More...
 
 getComponentId ()
 
 getActionTypes ()
 
 collectActionsForTargetUser ($a_target_user)
 Collect user actions. More...
 
- Public Member Functions inherited from ilUserActionProvider
 __construct ()
 Constructor. More...
 
 setUserId ($a_val)
 Set user id. More...
 
 getUserId ()
 Get user id. More...
 
 collectActionsForTargetUser ($a_target_user)
 Collect actions for a target user. More...
 
 getComponentId ()
 
 getActionTypes ()
 

Static Public Attributes

static $user_access = array()
 

Additional Inherited Members

- Protected Attributes inherited from ilUserActionProvider
 $user_id
 
 $lng
 
 $db
 

Detailed Description

Adds link to mail.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilMailUserActionProvider.php.

Member Function Documentation

◆ checkUserMailAccess()

ilMailUserActionProvider::checkUserMailAccess (   $a_user_id)

Check user chat access.

Parameters

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

References ilMailGlobalServices\getMailObjectRefId().

Referenced by collectActionsForTargetUser().

25  {
26  global $rbacsystem;
27 
28  if (!isset(self::$user_access[$a_user_id]))
29  {
30  include_once("./Services/Mail/classes/class.ilMailGlobalServices.php");
31  self::$user_access[$a_user_id] =
32  $rbacsystem->checkAccessOfUser($a_user_id, 'internal_mail', ilMailGlobalServices::getMailObjectRefId());
33  }
34  return self::$user_access[$a_user_id];
35  }
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ collectActionsForTargetUser()

ilMailUserActionProvider::collectActionsForTargetUser (   $a_target_user)

Collect user actions.

Parameters
int$a_target_usertarget user
Returns
ilUserActionCollection collection

Definition at line 61 of file class.ilMailUserActionProvider.php.

References ilObjUser\_lookupName(), array, checkUserMailAccess(), ilUserActionCollection\getInstance(), ilMailFormCall\getLinkTarget(), and ilUserActionProvider\getUserId().

62  {
64  include_once("./Services/User/Actions/classes/class.ilUserAction.php");
65  include_once("./Services/Mail/classes/class.ilMailFormCall.php");
66 
67  // check mail permission of user
68  if ($this->getUserId() == ANONYMOUS_USER_ID || !$this->checkUserMailAccess($this->getUserId()))
69  {
70  return $coll;
71  }
72 
73  // check mail permission of target user
74  if ($this->checkUserMailAccess($a_target_user))
75  {
76  $f = new ilUserAction();
77  $f->setType("compose");
78  $f->setText($this->lng->txt("mail"));
79  $tn = ilObjUser::_lookupName($a_target_user);
80  $f->setHref(ilMailFormCall::getLinkTarget("", '', array(), array('type' => 'new', 'rcp_to' => $tn["login"])));
81  $coll->addAction($f);
82  }
83 
84  return $coll;
85  }
static _lookupName($a_user_id)
lookup user name
static getInstance()
Get instance.
Create styles array
The data for the language used.
static getLinkTarget($gui, $cmd, Array $gui_params=array(), Array $mail_params=array(), $context_params=array())
checkUserMailAccess($a_user_id)
Check user chat access.
Action that can be performed on a user.
+ Here is the call graph for this function:

◆ getActionTypes()

ilMailUserActionProvider::getActionTypes ( )

Definition at line 48 of file class.ilMailUserActionProvider.php.

References array.

49  {
50  return array(
51  "compose" => $this->lng->txt("mail")
52  );
53  }
Create styles array
The data for the language used.

◆ getComponentId()

ilMailUserActionProvider::getComponentId ( )

Definition at line 40 of file class.ilMailUserActionProvider.php.

41  {
42  return "mail";
43  }

Field Documentation

◆ $user_access

ilMailUserActionProvider::$user_access = array()
static

Definition at line 16 of file class.ilMailUserActionProvider.php.


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