[Phpwm] .htaccess auth question

Rob Allen rob at akrabat.com
Mon Aug 6 15:54:23 BST 2007


pete graham wrote:
> I have found that if you redirect to
> http://username:password@siteaddress.com that this will login you in
> automatically for a .htaccess protected site.
> 
> What I need now if a way to retrieve the users password from my
> controller action in the Zend Framework. You can retrieve the
> username, real name, etc using $this->view->user->db_field_name,
> however this doesn't work for the password (for security reasons I
> guess).
> 

Should do - depending on where view->user came from. If it came from my
Zend Auth tutorial, you'll see that I explicitly remove password from
the list of fields stored into the Auth session:

	$data = $authAdapter->getResultRowObject(null, 'password');

(in AuthController::loginAction() somewhere around line 47)

Hence, if you change that line to:

	$data = $authAdapter->getResultRowObject();

then $this->view->user->password will be valid.

Regards,

Rob..



More information about the Phpwm mailing list