6.0.0-beta1
7/4/25

[#12519] Inconsistent use of $user & $username in passwd/lib/Driver/Ldap.php
Summary Inconsistent use of $user & $username in passwd/lib/Driver/Ldap.php
Queue Passwd
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester adorman (at) ironicdesign (dot) com
Created 07/31/2013 (4356 days ago)
Due
Updated 08/01/2013 (4355 days ago)
Assigned
Resolved 08/01/2013 (4355 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
08/01/2013 06:21:12 PM Michael Slusarz Comment #6 Reply to this comment
Jan's commit 
https://github.com/horde/horde/commit/a6cc00a83599434e441b824050248a2b7334b2cd

put the variables to $username now it's back to $user?
Because #12331 was an incorrect fix.  Passwd_Driver_Ldap inherits from 
Passwd_Driver.  In Passwd_Driver, $user is used.  Using anything else 
will throw PHP strict warnings since the method signatures do not match.
08/01/2013 11:16:41 AM simon (at) simonandkate (dot) net Comment #5 Reply to this comment
Jan's commit 
https://github.com/horde/horde/commit/a6cc00a83599434e441b824050248a2b7334b2cd

put the variables to $username now it's back to $user?
08/01/2013 02:28:17 AM adorman (at) ironicdesign (dot) com Comment #4 Reply to this comment

[Show Quoted Text - 14 lines]
Thanks Michael.
08/01/2013 12:28:29 AM Michael Slusarz Comment #3
Assigned to Michael Slusarz <slusarz@horde.org>
State ⇒ Resolved
Priority ⇒ 1. Low
Reply to this comment
Passwd 5.0.1.
08/01/2013 12:27:27 AM Git Commit Comment #2 Reply to this comment
Changes have been made in Git (master):

commit 0114ff62b9103f2c4b39c9867d6651f5d8c080e7
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Wed Jul 31 18:25:13 2013 -0600

     Bug #12519: match abstract method prototype

  passwd/lib/Driver/Kolab.php     |    6 +++---
  passwd/lib/Driver/Ldap.php      |   10 +++++-----
  passwd/lib/Driver/Smbpasswd.php |    2 +-
  3 files changed, 9 insertions(+), 9 deletions(-)

http://git.horde.org/horde-git/-/commit/0114ff62b9103f2c4b39c9867d6651f5d8c080e7
07/31/2013 08:39:06 PM adorman (at) ironicdesign (dot) com Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Inconsistent use of $user & $username in passwd/lib/Driver/Ldap.php
Queue ⇒ Passwd
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
The protected function _changePassword($user, $oldpass, $newpass) 
accepts $user as input, but it uses $username in a couple of places 
where it should be using $user.  This causes an incorrect user on line 
101 and empty userdn on line 110.

Sorry I do not have a full patch...But here is a diff showing the fixed lines.

diff ../Ldap.php.old ../Ldap.php.new
101c101
<             $username .= '@' . $this->_params['realm'];
---
             $user .= '@' . $this->_params['realm'];
109,110c109,110
<             // $this->_userdn = $this->_ldap->findUserDN($username);
<             $this->_userdn = $this->_params['uid'] . '=' . $username 
. ',' . $this->_params['basedn'];
---
             // $this->_userdn = $this->_ldap->findUserDN($user);
             $this->_userdn = $this->_params['uid'] . '=' . $user . 
',' . $this->_params['basedn'];

Saved Queries