ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMailUserActionProvider Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 checkUserMailAccess (int $a_user_id)
 
 getComponentId ()
 
 getActionTypes ()
 
 collectActionsForTargetUser (int $a_target_user)
 
- Public Member Functions inherited from ilUserActionProvider
 __construct ()
 
 setUserId (int $a_val)
 
 getUserId ()
 
 collectActionsForTargetUser (int $a_target_user)
 Collect actions for a target user. More...
 
 getComponentId ()
 
 getActionTypes ()
 
 getJsScripts (string $a_action_type)
 

Static Public Attributes

static array $user_access = []
 

Additional Inherited Members

- Protected Attributes inherited from ilUserActionProvider
int $user_id
 
Language $lng
 
ilDBInterface $db
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Adds link to mail

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ checkUserMailAccess()

ilMailUserActionProvider::checkUserMailAccess ( int  $a_user_id)

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

References $DIC, and ilMailGlobalServices\getMailObjectRefId().

Referenced by collectActionsForTargetUser().

27  : bool
28  {
29  global $DIC;
30 
31  $rbacsystem = $DIC['rbacsystem'];
32 
33  if (!isset(self::$user_access[$a_user_id])) {
34  self::$user_access[$a_user_id] =
35  $rbacsystem->checkAccessOfUser($a_user_id, 'internal_mail', ilMailGlobalServices::getMailObjectRefId());
36  }
37  return (bool) self::$user_access[$a_user_id];
38  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ collectActionsForTargetUser()

ilMailUserActionProvider::collectActionsForTargetUser ( int  $a_target_user)

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

References Vendor\Package\$f, ilObjUser\_lookupName(), ANONYMOUS_USER_ID, checkUserMailAccess(), ilMailFormCall\getLinkTarget(), ilUserActionProvider\getUserId(), and ILIAS\Repository\lng().

56  {
57  $coll = new ilUserActionCollection();
58 
59  // check mail permission of user
60  if ($this->getUserId() == ANONYMOUS_USER_ID || !$this->checkUserMailAccess($this->getUserId())) {
61  return $coll;
62  }
63 
64  // check mail permission of target user
65  if ($this->checkUserMailAccess($a_target_user)) {
66  $f = new ilUserAction();
67  $f->setType("compose");
68  $f->setText($this->lng->txt("mail"));
69  $tn = ilObjUser::_lookupName($a_target_user);
70  $f->setHref(ilMailFormCall::getLinkTarget("", '', [], ['type' => 'new', 'rcp_to' => $tn["login"]]));
71  $coll->addAction($f);
72  }
73 
74  return $coll;
75  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
static _lookupName(int $a_user_id)
lookup user name
static getLinkTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getActionTypes()

ilMailUserActionProvider::getActionTypes ( )
Returns
array<string,string>

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

References ILIAS\Repository\lng().

48  : array
49  {
50  return [
51  "compose" => $this->lng->txt("mail")
52  ];
53  }
+ Here is the call graph for this function:

◆ getComponentId()

ilMailUserActionProvider::getComponentId ( )

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

40  : string
41  {
42  return "mail";
43  }

Field Documentation

◆ $user_access

array ilMailUserActionProvider::$user_access = []
static

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


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