FFSS
FFSS

Reputation: 133

Zend_Auth no giving all info

I am having this issue with Zend and Doctrine and I am hoping someone can help me understand what I am doing wrong:-

My login controller is as follow:

....    
if ($result->isValid()) {

   $session = new Zend_Session_Namespace('tcc.auth');

      $identity = $adapter->getResultArray('password');

      $auth->getStorage()->write($identity); 
.....

In my index controller dispatch I call

$session = new Zend_Session_Namespace('tcc.auth');

what is not working as I hoped is that if I do this:

print_r (Zend_Auth::getInstance()->getIdentity());

I get the all Array correctly, bit if I want to get ie userid only and do this:

Zend_Auth::getInstance()->getIdentity()->userid;

I get nothing. It is just empty!

I am puzzled about what I am doing wrong. Can someone please please help?

Upvotes: 0

Views: 203

Answers (1)

dinopmi
dinopmi

Reputation: 2673

Maybe I'm mistaken, but if it's an array, wouldn't this be the proper way to retrieve it?

$identity = Zend_Auth::getInstance()->getIdentity();
$userId = $identity['userid'];

Hope that helps,

Upvotes: 2

Related Questions