ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilAwarenessMailFeatureProvider.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once("./Services/Awareness/classes/class.ilAwarenessFeatureProvider.php");
6
15{
16 static $user_access = array();
17
24 function checkUserMailAccess($a_user_id)
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 }
36
43 function collectFeaturesForTargetUser($a_target_user)
44 {
46 include_once("./Services/Awareness/classes/class.ilAwarenessFeature.php");
47 include_once("./Services/Mail/classes/class.ilMailFormCall.php");
48
49 // check mail permission of user
50 if ($this->getUserId() == ANONYMOUS_USER_ID || !$this->checkUserMailAccess($this->getUserId()))
51 {
52 return $coll;
53 }
54
55 // check mail permission of target user
56 if ($this->checkUserMailAccess($a_target_user))
57 {
58 $f = new ilAwarenessFeature();
59 $f->setText($this->lng->txt("mail"));
60 $tn = ilObjUser::_lookupName($a_target_user);
61 $f->setHref(ilMailFormCall::getLinkTarget("", '', array(), array('type' => 'new', 'rcp_to' => $tn["login"])));
62 $coll->addFeature($f);
63 }
64
65 return $coll;
66 }
67}
68?>
A class that provides a collection of features for the awareness tool.
Awareness tool feature (presented in user drop downs) (data object)
checkUserMailAccess($a_user_id)
Check user chat access.
collectFeaturesForTargetUser($a_target_user)
Collect all features.
static getLinkTarget($gui, $cmd, Array $gui_params=array(), Array $mail_params=array(), $context_params=array())
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable.
static _lookupName($a_user_id)
lookup user name