summaryrefslogtreecommitdiff
path: root/plugins/kolab_delegation
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-01-21 15:58:09 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-01-21 15:58:09 (GMT)
commitd9f69d35c7ebbdd0544351db5cbed810ce431072 (patch)
treea2ecc29647ae598f48508ea04c08762609e824da /plugins/kolab_delegation
parentd6789046c6bb5575c13616003ffa4734a75f860b (diff)
downloadroundcubemail-plugins-kolab-d9f69d35c7ebbdd0544351db5cbed810ce431072.tar.gz
Allow to provide the context for getting user emails (augmented by kolab_delegation)
Diffstat (limited to 'plugins/kolab_delegation')
-rw-r--r--plugins/kolab_delegation/kolab_delegation_engine.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/kolab_delegation/kolab_delegation_engine.php b/plugins/kolab_delegation/kolab_delegation_engine.php
index ca4d5b4..be16cf6 100644
--- a/plugins/kolab_delegation/kolab_delegation_engine.php
+++ b/plugins/kolab_delegation/kolab_delegation_engine.php
@@ -743,6 +743,13 @@ class kolab_delegation_engine
{
$context = $this->delegator_context();
+ // try to derive context from the given user email
+ if (!$context && !empty($args['emails'])) {
+ if (($user = preg_replace('/@.+$/', '', $args['emails'][0])) && isset($_SESSION['delegators'][$user])) {
+ $context = $user;
+ }
+ }
+
// return delegator's addresses
if ($context) {
$args['emails'] = $_SESSION['delegators'][$context];