From 0bd58bddfc87a637ab73b6f0d8fd558418843b38 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 14 Apr 2014 18:13:51 +0200 Subject: [PATCH] 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']) {