[Tickets #10228] Re: Add API methods to reset cached credentials inside applications

bugs at horde.org bugs at horde.org
Fri Sep 9 18:55:58 UTC 2011


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/10228
------------------------------------------------------------------------------
  Ticket             | 10228
  Updated By         | adominguez at cne.gob.ve
  Summary            | Add API methods to reset cached credentials inside
                     | applications
  Queue              | Horde Framework Packages
  Version            | Git master
  Type               | Enhancement
  State              | Accepted
  Priority           | 2. Medium
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


adominguez at cne.gob.ve (2011-09-09 18:55) wrote:

> Paste from Mailing list:
>
> I am using the passwd code from git which I downloaded on June 6. It  
> works, but does not reset my credentials within Horde, so I have to  
> log out and log back in. My system is setup such that Horde  
> authenticates via Imp and Imp uses IMAP Authentication. When I  
> change my password with passwd, it successfully changes the password  
> but IMP keeps trying to authenticate with the old password.

Hi I'm using the passwd code too, and I got the same problem whit it .  
I found that that the problem is  inside the function resetCredentials  
on passwd/lib/Passwd.php, first because the call to  
setAuthCredential() to set the new password is made on wrong way, we  
have to change from:

$GLOBALS['registry']->setAuthCredential('password', $new_password);

  to:

$GLOBALS['registry']->setAuthCredential('password', $new_password,  
$GLOBALS['session']->get('horde', 'auth/credentials'));


That's because the third parameter (The app name) on function  
setAuthCredential is bad calculate on class Horde_Registry when it is  
not passed to if function (because is optional), but the same  
parameter  on function getAuthCredential is rigth calculated when it's  
missing, so it could be a bug on  setAuthCredential.

But it is not over, because the class IMP_Imap have the configuration  
to conect to the IMAP server where it save the user a password and we  
have to reset that configuration and pass the new password, so on  
function resetCredentials  we have to add:

$imp_imap =  
$GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create(null,  
true);$imp_imap->ob=NULL;
$imp_imap->createImapObject($GLOBALS['registry']->getAuth('bare'),  
$new_password, IMP_Auth::getAutoLoginServer());


And that is it.








More information about the bugs mailing list