summaryrefslogtreecommitdiff
path: root/lib/Auth/LDAP.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Auth/LDAP.php')
-rw-r--r--lib/Auth/LDAP.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Auth/LDAP.php b/lib/Auth/LDAP.php
index 506e3e5..e748347 100644
--- a/lib/Auth/LDAP.php
+++ b/lib/Auth/LDAP.php
@@ -245,8 +245,11 @@ class LDAP
public function get_attribute($subject_dn, $attribute)
{
- $result = ldap_read($this->conn, $subject_dn, '(objectclass=*)', (array)($attribute));
- console($result);
+ $result = $this->search($subject_dn, '(objectclass=*)', (array)($attribute));
+ $result = self::normalize_result($result);
+ $dn = key($result);
+ $attr = key($result[$dn]);
+ return $result[$dn][$attr];
}
public function get_attributes($subject_dn, $attributes)