Well, I try that before and doesn't work, look what I got:

echo "<hr>Before hasIdentity!";
// If we have an user authenticated.
if ( $objAuth->hasIdentity() )
{
echo "<hr>Inside the if hasIdentity!";

And look what I got when I look for the echoes:

Before hasIdentity!

The echo inside the if() is never printed. Seems like when I try to execute 
some method from the Zend_Auth class I can't.

Thx for any help.

----- Original Message -----
From: "Aissam Bazzaoui" <[EMAIL PROTECTED]>
To: "Juan Felipe Alavarez Saldarriaga" <[EMAIL PROTECTED]>, "fw-general" 
<[email protected]>
Sent: miércoles 3 de octubre de 2007 15H01 (GMT-0500) America/Bogota
Subject: RE : [fw-general] Zend_AUth::getInstance issue

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