ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 
 getJsScripts ($a_action_type)
 Get js scripts. More...
 
 getCssFiles ($a_action_type)
 Get css resource files. More...
 

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 $DIC, and ilMailGlobalServices\getMailObjectRefId().

Referenced by collectActionsForTargetUser().

25  {
26  global $DIC;
27 
28  $rbacsystem = $DIC['rbacsystem'];
29 
30  if (!isset(self::$user_access[$a_user_id])) {
31  include_once("./Services/Mail/classes/class.ilMailGlobalServices.php");
32  self::$user_access[$a_user_id] =
33  $rbacsystem->checkAccessOfUser($a_user_id, 'internal_mail', ilMailGlobalServices::getMailObjectRefId());
34  }
35  return self::$user_access[$a_user_id];
36  }
global $DIC
Definition: saml.php:7
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 62 of file class.ilMailUserActionProvider.php.

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

63  {
65  include_once("./Services/User/Actions/classes/class.ilUserAction.php");
66  include_once("./Services/Mail/classes/class.ilMailFormCall.php");
67 
68  // check mail permission of user
69  if ($this->getUserId() == ANONYMOUS_USER_ID || !$this->checkUserMailAccess($this->getUserId())) {
70  return $coll;
71  }
72 
73  // check mail permission of target user
74  if ($this->checkUserMailAccess($a_target_user)) {
75  $f = new ilUserAction();
76  $f->setType("compose");
77  $f->setText($this->lng->txt("mail"));
78  $tn = ilObjUser::_lookupName($a_target_user);
79  $f->setHref(ilMailFormCall::getLinkTarget("", '', array(), array('type' => 'new', 'rcp_to' => $tn["login"])));
80  $coll->addAction($f);
81  }
82 
83  return $coll;
84  }
static _lookupName($a_user_id)
lookup user name
static getInstance()
Get instance.
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 49 of file class.ilMailUserActionProvider.php.

50  {
51  return array(
52  "compose" => $this->lng->txt("mail")
53  );
54  }

◆ getComponentId()

ilMailUserActionProvider::getComponentId ( )

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

42  {
43  return "mail";
44  }

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: