summaryrefslogtreecommitdiff
path: root/plugins/kolab_delegation/kolab_delegation_engine.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/kolab_delegation/kolab_delegation_engine.php')
-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];