check identity before getting it :

  if ($objAuth->hasIdentity())

it's on manual
http://framework.zend.com/manual/en/zend.auth.html
;)

--- Juan Felipe Alavarez Saldarriaga
<[EMAIL PROTECTED]> a écrit :

> :)
> 
> I got this issue, I have a plugin named
> TemplatePlugin, this plugin injects the current view
> into a template add by myself, in the
> dispatchLoopShutdown method from the plugin I have
> this code:
> 
> // Get Zend Auth Instance
> $objAuth = Zend_Auth::getInstance();
> 
> So then I make this:
> 
> // Get user fields
> $objUser = $objAuth->getIdentity();
> // Set user name to show in template
> $objView->usrName = $objUser->first_name . " " .
> $objUser->last_name;
> 
> So, what's the issue ? If the user is not logged in
> via Zend_Auth the value the Zend_Auth have no data,
> but when I try to execute the getIdentity method
> from the Zend_Auth class the process is stoped.
> 
> This is the return from the Zend_Auth::getInstance()
> method:
> 
> objAuth:
> 
> Zend_Auth Object
> (
>     [_storage:protected] => 
> )
> 
> So I was trying to execute getIdentity method from
> the Zend_Auth class and when I do that the process
> stop, I guess is because I don't have anything to
> do, I try to use the getStorage method and the same,
> the process stop when I execute one of the methods
> from the Zend_Auth.
> 
> Is there a way to validate the existence of the
> Zend_Auth method ?
> 
> Thx for any help.
> 
> 
> 

Reply via email to