logo       

Re: Using Zend_Auth to retrieve a user's role to use in Zend_Acl: msg#00014

php.zend.framework.auth

Subject: Re: Using Zend_Auth to retrieve a user's role to use in Zend_Acl

It isn't unfortunate that you already have your own Db adapter in hand. You need it to pass to the constructor of Zend_Auth_Adapter_DbTable.

I'm not sure I understand what the problem is.

On 10/3/07, Vincent <imnotb-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote:

Unfortunately I already use my own DB adapter, but when I started to look how Zend_Auth_Adapter_DbTable returned a result, I started to doubt that that would work.

The page you linked to mentions the user of

$result $authAdapter
->authenticate();

echo $result->
getIdentity
() . "\n\n";

However, looking through the source I see that as an identity, $authResult['identity'] is returned, which is set to $this->_identity, which is supposed to be a string (not an object, so you shouldn't be able to do ->getIdentity() on it). I'm using Zend Framework 1.0.0, could it be that the reference is outdated?

Then you should be able to do something like

Zend_Auth::getInstance()->getStorage()->read()->role


--
David Mintz
http://davidmintz.org/

The subtle source is clear and bright
The tributary streams flow through the darkness
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise