ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilMailFormCall Class Reference
+ Collaboration diagram for ilMailFormCall:

Static Public Member Functions

static getLinkTarget ( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
 
static getRedirectTarget ( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
 
static storeReferer (array $query_parameters)
 
static getSignature ()
 
static getRefererRedirectUrl ()
 
static isRefererStored ()
 
static getContextId ()
 
static setContextId (?string $id)
 
static getContextParameters ()
 
static setContextParameters (array $parameters)
 
static setRecipients (array $recipients, string $type='to')
 
static getRecipients (string $type='to')
 

Data Fields

final const string SESSION_KEY = 'mail_transport'
 
final const string REFERER_KEY = 'r'
 
final const string SIGNATURE_KEY = 'sig'
 
final const string CONTEXT_PREFIX = 'ctx'
 
final const string CONTEXT_KEY = 'ctx_template'
 

Static Protected Member Functions

static getTargetUrl (string $argument_separator, $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
 

Detailed Description

Definition at line 21 of file class.ilMailFormCall.php.

Member Function Documentation

◆ getContextId()

static ilMailFormCall::getContextId ( )
static

Definition at line 194 of file class.ilMailFormCall.php.

References ilSession\get(), and null.

Referenced by ilMailFormGUI\editAttachments(), ilMailFormGUI\saveDraft(), ilMailFormGUI\saveMailBeforeSearch(), ilMailFormGUI\searchUsers(), ilForumMailEventNotificationSender\send(), ilMailFormGUI\sendMessage(), and ilMailFormGUI\showForm().

194  : ?string
195  {
196  $session = ilSession::get(self::SESSION_KEY);
197  return (
198  isset($session[self::CONTEXT_PREFIX][self::CONTEXT_KEY]) &&
199  is_string($session[self::CONTEXT_PREFIX][self::CONTEXT_KEY]) ?
200  $session[self::CONTEXT_PREFIX][self::CONTEXT_KEY] : null
201  );
202  }
static get(string $a_var)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getContextParameters()

static ilMailFormCall::getContextParameters ( )
static

Definition at line 211 of file class.ilMailFormCall.php.

References ilSession\get().

Referenced by ilMailFormGUI\editAttachments(), ilMailFormGUI\saveDraft(), ilMailFormGUI\saveMailBeforeSearch(), ilMailFormGUI\searchUsers(), ilForumMailEventNotificationSender\send(), and ilMailFormGUI\sendMessage().

211  : array
212  {
213  $session = ilSession::get(self::SESSION_KEY);
214  if (isset($session[self::CONTEXT_PREFIX]) && is_array($session[self::CONTEXT_PREFIX])) {
215  return $session[self::CONTEXT_PREFIX];
216  }
217 
218  return [];
219  }
static get(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLinkTarget()

static ilMailFormCall::getLinkTarget (   $gui,
string  $cmd,
array  $gui_params = [],
array  $mail_params = [],
array  $context_params = [] 
)
static
Parameters
object | string$gui

Definition at line 32 of file class.ilMailFormCall.php.

Referenced by ilMailUserActionProvider\collectActionsForTargetUser(), ilAppointmentPresentationCourseGUI\collectPropertiesAndActions(), ilAssignedUsersTableGUI\getContactLink(), ilPublicUserProfileGUI\getEmbeddable(), ilTutorialSupportBlockGUI\getMailUrlOfUser(), and ilObjCourseGUI\infoScreen().

38  : string {
39  return self::getTargetUrl('&', $gui, $cmd, $gui_params, $mail_params, $context_params);
40  }
+ Here is the caller graph for this function:

◆ getRecipients()

static ilMailFormCall::getRecipients ( string  $type = 'to')
static
Returns
list<string>

Definition at line 241 of file class.ilMailFormCall.php.

References ilSession\get().

Referenced by ilMailGUI\executeCommand().

241  : array
242  {
243  $session = ilSession::get(self::SESSION_KEY) ?? [];
244  $key = 'rcp_' . $type;
245  if (isset($session[$key]) && is_array($session[$key])) {
246  return array_map('strval', array_values($session[$key]));
247  }
248 
249  return [];
250  }
static get(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRedirectTarget()

◆ getRefererRedirectUrl()

static ilMailFormCall::getRefererRedirectUrl ( )
static

Definition at line 155 of file class.ilMailFormCall.php.

References $parts, $url, ilUtil\_getHttpPath(), ilSession\get(), and ilSession\set().

Referenced by ilMailFormGUI\cancelMail(), ilMailFormGUI\saveDraft(), and ilMailFormGUI\sendMessage().

155  : string
156  {
157  $url = '';
158  $session = ilSession::get(self::SESSION_KEY);
159 
160  if (isset($session[self::REFERER_KEY])) {
161  $url = $session[self::REFERER_KEY];
162  if (is_string($url) && $url !== '') {
163  $parts = parse_url($url);
164  if (isset($parts['query']) && $parts['query'] !== '') {
165  $url .= '&returned_from_mail=1';
166  } else {
167  $url .= '?returned_from_mail=1';
168  }
169 
170  $ilias_url_parts = parse_url(ilUtil::_getHttpPath());
171  if (isset($parts['host']) && $ilias_url_parts['host'] !== $parts['host']) {
172  $url = 'ilias.php?baseClass=ilMailGUI';
173  }
174  }
175 
176  unset($session[self::REFERER_KEY]);
177  ilSession::set(self::SESSION_KEY, $session);
178  }
179 
180  return $url;
181  }
static get(string $a_var)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
$url
Definition: shib_logout.php:68
static _getHttpPath()
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSignature()

static ilMailFormCall::getSignature ( )
static

Definition at line 140 of file class.ilMailFormCall.php.

References ilSession\get(), and ilSession\set().

Referenced by ilMailFormGUI\showForm().

140  : string
141  {
142  $sig = '';
143  $session = ilSession::get(self::SESSION_KEY);
144 
145  if (isset($session[self::SIGNATURE_KEY])) {
146  $sig = $session[self::SIGNATURE_KEY];
147 
148  unset($session[self::SIGNATURE_KEY]);
149  ilSession::set(self::SESSION_KEY, $session);
150  }
151 
152  return $sig;
153  }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTargetUrl()

static ilMailFormCall::getTargetUrl ( string  $argument_separator,
  $gui,
string  $cmd,
array  $gui_params = [],
array  $mail_params = [],
array  $context_params = [] 
)
staticprotected
Parameters
object | string$gui

Definition at line 58 of file class.ilMailFormCall.php.

References $DIC.

65  : string {
66  global $DIC;
67 
68  $mparams = '';
69  $referer = '';
70 
71  foreach ($mail_params as $key => $value) {
72  $mparams .= $argument_separator . $key . '=' . urlencode((string) $value);
73  }
74 
75  foreach ($context_params as $key => $value) {
76  if ($key === self::CONTEXT_KEY) {
77  $mparams .= $argument_separator . $key . '=' . urlencode((string) $value);
78  } else {
79  $mparams .= $argument_separator . self::CONTEXT_PREFIX . '_' . $key . '=' . urlencode((string) $value);
80  }
81  }
82 
83  if (is_object($gui)) {
84  $ctrl_tmp = clone $DIC->ctrl();
85  foreach ($gui_params as $key => $value) {
86  $ctrl_tmp->setParameter($gui, $key, $value);
87  }
88  $referer = $ctrl_tmp->getLinkTarget($gui, $cmd, '');
89  } elseif (is_string($gui)) {
90  $referer = $gui;
91  }
92 
93  $referer = $argument_separator . self::REFERER_KEY . '=' . rawurlencode(base64_encode((string) $referer));
94 
95  return 'ilias.php?baseClass=ilMailGUI' . $referer . $mparams;
96  }
global $DIC
Definition: shib_login.php:26

◆ isRefererStored()

static ilMailFormCall::isRefererStored ( )
static

Definition at line 183 of file class.ilMailFormCall.php.

References ilSession\get().

Referenced by ilMailFormGUI\cancelMail(), ilMailFormGUI\saveDraft(), ilMailFormGUI\sendMessage(), and ilMailFormGUI\showForm().

183  : bool
184  {
185  $session = ilSession::get(self::SESSION_KEY);
186 
187  return (
188  isset($session[self::REFERER_KEY]) &&
189  is_string($session[self::REFERER_KEY]) &&
190  $session[self::REFERER_KEY] !== ''
191  );
192  }
static get(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setContextId()

static ilMailFormCall::setContextId ( ?string  $id)
static

Definition at line 204 of file class.ilMailFormCall.php.

References $id, ilSession\get(), and ilSession\set().

Referenced by ilMailFormGUI\showForm().

204  : void
205  {
206  $session = ilSession::get(self::SESSION_KEY);
207  $session[self::CONTEXT_KEY] = $id;
208  ilSession::set(self::SESSION_KEY, $session);
209  }
static get(string $a_var)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setContextParameters()

static ilMailFormCall::setContextParameters ( array  $parameters)
static

Definition at line 221 of file class.ilMailFormCall.php.

References ilSession\get(), and ilSession\set().

Referenced by ilMailFormGUI\showForm().

221  : void
222  {
223  $session = ilSession::get(self::SESSION_KEY);
224  $session[self::CONTEXT_PREFIX] = $parameters;
225  ilSession::set(self::SESSION_KEY, $session);
226  }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRecipients()

static ilMailFormCall::setRecipients ( array  $recipients,
string  $type = 'to' 
)
static
Parameters
list<string>$recipients

Definition at line 231 of file class.ilMailFormCall.php.

References ilSession\get(), and ilSession\set().

Referenced by ilMailGUI\executeCommand(), ilSurveyParticipantsGUI\mailRatersObject(), ilBookingReservationsGUI\redirectMailToBooker(), ilStudyProgrammeMailMemberSearchGUI\sendMailToSelectedUsers(), ilMailMemberSearchGUI\sendMailToSelectedUsers(), and ilMembershipGUI\sendMailToSelectedUsers().

231  : void
232  {
233  $session = ilSession::get(self::SESSION_KEY) ?? [];
234  $session['rcp_' . $type] = array_map('strval', array_values($recipients));
235  ilSession::set(self::SESSION_KEY, $session);
236  }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeReferer()

static ilMailFormCall::storeReferer ( array  $query_parameters)
static
Parameters
array<string,mixed>$query_parameters

Definition at line 101 of file class.ilMailFormCall.php.

References ilSession\get(), and ilSession\set().

Referenced by ilMailGUI\executeCommand().

101  : void
102  {
103  $session = ilSession::get(self::SESSION_KEY);
104 
105  if (isset($query_parameters[self::REFERER_KEY])) {
106  $session[self::REFERER_KEY] = base64_decode(rawurldecode((string) $query_parameters[self::REFERER_KEY]));
107  $session[self::SIGNATURE_KEY] = base64_decode(
108  rawurldecode(
109  $query_parameters[self::SIGNATURE_KEY] ?? ''
110  )
111  );
112 
113  $context_parameters = [];
114  foreach ($query_parameters as $key => $value) {
115  $prefix = substr($key, 0, strlen(self::CONTEXT_PREFIX));
116  if ($prefix === self::CONTEXT_PREFIX) {
117  if ($key === self::CONTEXT_KEY) {
118  $context_parameters[$key] = $value;
119  } else {
120  $context_parameters[substr($key, strlen(self::CONTEXT_PREFIX . '_'))] = $value;
121  }
122  }
123  }
124  $session[self::CONTEXT_PREFIX] = $context_parameters;
125  } else {
126  if (isset($session[self::REFERER_KEY])) {
127  unset($session[self::REFERER_KEY]);
128  }
129  if (isset($session[self::SIGNATURE_KEY])) {
130  unset($session[self::SIGNATURE_KEY]);
131  }
132  if (isset($session[self::CONTEXT_PREFIX])) {
133  unset($session[self::CONTEXT_PREFIX]);
134  }
135  }
136 
137  ilSession::set(self::SESSION_KEY, $session);
138  }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ CONTEXT_KEY

◆ CONTEXT_PREFIX

final const string ilMailFormCall::CONTEXT_PREFIX = 'ctx'

Definition at line 26 of file class.ilMailFormCall.php.

◆ REFERER_KEY

final const string ilMailFormCall::REFERER_KEY = 'r'

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

◆ SESSION_KEY

final const string ilMailFormCall::SESSION_KEY = 'mail_transport'

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

◆ SIGNATURE_KEY


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