[#2435] $conf['auth']['params']['uid'], horde/lib/Horde/Auth/ldap.php, and case issues
Summary $conf['auth']['params']['uid'], horde/lib/Horde/Auth/ldap.php, and case issues
Queue Horde Base
Queue Version 3.0.5
Type Bug
State Resolved
Priority 1. Low
Owners Horde Developers
Requester beau (at) zoicstudios (dot) com
Created 08/12/2005 (1245 days ago)
Due
Updated 08/04/2006 (888 days ago)
Assigned 08/12/2005 (1245 days ago)
Resolved 08/04/2006 (888 days ago)
Attachments
Milestone
Patch No

History
08/04/2006 Jan Schneider Comment #3
State ⇒ Resolved
Reply to this comment
Fixed in CVS and Horde 3.1.3
08/12/2005 beau (at) zoicstudios (dot) com Comment #2 Reply to this comment
If you look at:

http://us2.php.net/ldap_search

you'll see someone has added a comment that results returned by 
ldap_search have their keys set to all lowercase--looks like this is a 
problem with the PHP SNMP extension.
08/12/2005 Jan Schneider State ⇒ Assigned
Assigned to Horde DevelopersHorde Developers
 
08/12/2005 beau (at) zoicstudios (dot) com Comment #1
Queue ⇒ Horde Base
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ $conf['auth']['params']['uid'], horde/lib/Horde/Auth/ldap.php, and case issues
Reply to this comment
If you specify $conf['auth']['params']['uid'] (in 
horde/config/conf.php) to be a mixed-case string like "sAMAccountName" 
then many of the functions in horde/lib/Horde/Auth/ldap.php will break.

From line 313:

         $search = ldap_search($ldap, $this->_params['basedn'], 
$filter, array($this->_params['uid']));
         $entries = ldap_get_entries($ldap, $search);
         $userlist = array();

         for ($i = 0; $i < $entries['count']; $i++) {
             $userlist[$i] = $entries[$i][$this->_params['uid']][0];
         }

In the for loop, $entries[$i]["sAMAccountName"][0] is added to 
$userlist[$i], but that key does not exist.

For some reason it is converted to lowercase at some point, so if you 
dump the variable you will see it contains 
$entries[$i]["samaccountname"][0].

If you set $conf['auth']['params']['uid'] to "samaccountname" 
everything works, but I imagine many people will set it to the 
mixed-cased version and there is no note to do otherwise.