summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ldap_servers/LdapServer.class.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/ldap_servers/LdapServer.class.php b/ldap_servers/LdapServer.class.php
index f148dbb..7735bec 100644
--- a/ldap_servers/LdapServer.class.php
+++ b/ldap_servers/LdapServer.class.php
@@ -960,13 +960,16 @@ class LdapServer {
*/
public function userUsernameFromLdapEntry($ldap_entry) {
- $accountname = FALSE;
+
if ($this->account_name_attr) {
- $accountname = (empty($ldap_entry[$this->user_attr][0])) ? FALSE : $ldap_entry[$this->account_name_attr][0];
+ $accountname = (empty($ldap_entry[$this->account_name_attr][0])) ? FALSE : $ldap_entry[$this->account_name_attr][0];
}
elseif ($this->user_attr) {
$accountname = (empty($ldap_entry[$this->user_attr][0])) ? FALSE : $ldap_entry[$this->user_attr][0];
}
+ else {
+ $accountname = FALSE;
+ }
return $accountname;
}