summaryrefslogtreecommitdiffstats
path: root/lib/Auth
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2015-03-05 05:07:07 -0500
committerAleksander Machniak <machniak@kolabsys.com>2015-03-05 05:07:07 -0500
commitd5c7eeb50de5e0952a0e303a1cd1e046dbdb0eb0 (patch)
tree69c9ebc6203247d02f1b85c5212e8032b60760d2 /lib/Auth
parent74319e95a36347f474e49bbbff04e95a561c106e (diff)
downloadwebadmin-d5c7eeb50de5e0952a0e303a1cd1e046dbdb0eb0.tar.gz
Fix regression related to incorrect find_domain() result handling (#4786)
Diffstat (limited to 'lib/Auth')
-rw-r--r--lib/Auth/LDAP.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php
index 1588500..ce0762e 100644
--- a/lib/Auth/LDAP.php
+++ b/lib/Auth/LDAP.php
@@ -430,7 +430,11 @@ class LDAP extends Net_LDAP3 {
$domain_dn = $this->entry_dn($domain, array(), $domain_base_dn);
if (!$domain_dn) {
- $result = $this->find_domain($domain, $attributes);
+ if ($result = $this->find_domain($domain, $attributes)) {
+ $result_dn = $result['dn'];
+ unset($result['dn']);
+ $result = array($result_dn => $result);
+ }
}
else {
$result = $this->_read($domain_dn, $attributes);
@@ -1042,7 +1046,7 @@ class LDAP extends Net_LDAP3 {
* @param string $domain Domain name
* @param array $attributes Result attributes
*
- * @return array|bool Domain attributes or False on error
+ * @return array|bool Domain attributes (+ 'dn' attribute) or False on error
*/
public function find_domain($domain, $attributes = array('*'))
{