From 0bd58bddfc87a637ab73b6f0d8fd558418843b38 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 14 Apr 2014 18:13:51 +0200 Subject: [PATCH 1/3] Fix bug where user could delegate himself (Bug #2981) --- plugins/kolab_delegation/kolab_delegation_engine.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/kolab_delegation/kolab_delegation_engine.php b/plugins/kolab_delegation/kolab_delegation_engine.php index ef869f29..ad96831b 100644 --- a/plugins/kolab_delegation/kolab_delegation_engine.php +++ b/plugins/kolab_delegation/kolab_delegation_engine.php @@ -427,6 +427,11 @@ class kolab_delegation_engine $result = $ldap->search($fields, $search, $mode, (array)$this->ldap_login_field, $max); foreach ($result as $record) { + // skip self + if ($record['dn'] == $_SESSION['kolab_dn']) { + continue; + } + $user = $this->parse_ldap_record($record); if ($user['name']) { From 02102bea4c6b43da8e961c5812d078f4250e004b Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 14 Apr 2014 18:14:47 +0200 Subject: [PATCH 2/3] Do not send localization in ajax responses --- plugins/kolab_delegation/kolab_delegation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/kolab_delegation/kolab_delegation.php b/plugins/kolab_delegation/kolab_delegation.php index 8b4a5ef9..62b8d041 100644 --- a/plugins/kolab_delegation/kolab_delegation.php +++ b/plugins/kolab_delegation/kolab_delegation.php @@ -320,7 +320,7 @@ class kolab_delegation extends rcube_plugin */ public function controller_action() { - $this->add_texts('localization/', true); + $this->add_texts('localization/'); $engine = $this->engine(); From 1a6f7e8b2847e3190c08ea6748df1eb687fbc38d Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 14 Apr 2014 18:23:08 +0200 Subject: [PATCH 3/3] Fix bug where "searching..." message wasn't removed on autocomplete response --- plugins/kolab_delegation/kolab_delegation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/kolab_delegation/kolab_delegation.php b/plugins/kolab_delegation/kolab_delegation.php index 62b8d041..fb3e4be1 100644 --- a/plugins/kolab_delegation/kolab_delegation.php +++ b/plugins/kolab_delegation/kolab_delegation.php @@ -376,10 +376,10 @@ class kolab_delegation extends rcube_plugin // Delegate autocompletion else if ($this->rc->action == 'plugin.delegation-autocomplete') { $search = get_input_value('_search', RCUBE_INPUT_GPC, true); - $sid = get_input_value('_id', RCUBE_INPUT_GPC); + $reqid = get_input_value('_reqid', RCUBE_INPUT_GPC); $users = $engine->list_users($search); - $this->rc->output->command('ksearch_query_results', $users, $search, $sid); + $this->rc->output->command('ksearch_query_results', $users, $search, $reqid); } $this->rc->output->send();