Issue #1899336: Error in account_name_attr code where AccountName attribute was being...
authorjohnbarclay
Mon, 25 Mar 2013 13:38:22 +0000 (08:38 -0500)
committerjohnbarclay
Mon, 25 Mar 2013 13:38:22 +0000 (08:38 -0500)
ldap_servers/LdapServer.class.php

index f148dbb..7735bec 100644 (file)
@@ -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;
   }