6.0.0-beta1
7/5/25

[#10704] Password is not updated in session
Summary Password is not updated in session
Queue Passwd
Queue Version 4.0
Type Bug
State Duplicate
Priority 1. Low
Owners
Requester azurit (at) pobox (dot) sk
Created 11/02/2011 (4994 days ago)
Due
Updated 12/20/2011 (4946 days ago)
Assigned
Resolved 11/02/2011 (4994 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
12/20/2011 08:05:10 PM azurit (at) pobox (dot) sk Comment #4 Reply to this comment
Can this be reopened?

I started to digging deeper into this and i found out something
interesting. When password is changed it is reseted in cache via
resetCredentials function. This function is reseting password stored
in memory (in session). Problem is that password from session is NEVER
used for logging into IMAP server.

Login to IMAP is done via Horde_Imap_Client which takes login and
password as argument (in $params) and these values are set ONLY in
constructor (this is done by Horde/IMP in createImapObject function
called in Auth.php). Problem is that IMAP object is initialized only
ONCE per IMAP login in our installation - so, when password changes,
it is correctly updated in session but gets NEVER updated in IMAP
object. I was doing some debug logging inside Horde and Horde/IMP and
it is really like this, constructor for Horde_Imap_Client is called
only once per login, the IMAP object is probably serialized and cached
somewhere.

Sending patch which works for me:

File: passwd/lib/Passwd.php
Function (at the end of file): resetCredentials
Code (i added 3 lines which starts by '$imp_imap'):

      static public function resetCredentials($old_password, $new_password)
      {
          if ($GLOBALS['registry']->getAuthCredential('password') == 
$old_password) {
              $GLOBALS['registry']->setAuthCredential('password', 
$new_password);

              $imp_imap = 
$GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create();
              $imp_imap->ob = NULL;
               
$imp_imap->createImapObject($GLOBALS['registry']->getAuth(), 
$new_password, IMP_Auth::getAutoLoginServer());
          }
      }
11/02/2011 08:01:15 PM azurit (at) pobox (dot) sk Comment #3 Reply to this comment
what exactly do i need to install to fix it ? in which versions it was fixed ?
11/02/2011 07:37:57 PM Jan Schneider Comment #2
State ⇒ Duplicate
Priority ⇒ 1. Low
Reply to this comment
Duplicate of #10228 and I still don't see this (anymore).
11/02/2011 06:53:23 PM azurit (at) pobox (dot) sk Comment #1
Priority ⇒ 3. High
Patch ⇒ No
Milestone ⇒
Queue ⇒ Passwd
Summary ⇒ Password is not updated in session
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
When using poppassd backend, password is changed correctly on IMAP 
server but is NOT updated in Horde session. You need to logout and 
login from/to Horde or nothing will work after password is changed.

Saved Queries