If not $sf_user->isAuthenticated() then $sf_user->getGuardUser()
returns null without any warning/exception, so trying ->getUsername()
or anything else should lead you to troubles

On May 8, 5:30 am, Johannes Frandsen <[EMAIL PROTECTED]> wrote:
> Hi
>
> I have now installed sfGuardDoctrine and the login feature seems to
> work.
>
> I would however like it to be optional to login, and show you some
> information based on whether you are logged in or not.
>
> How is this accomplished?
>
> If i try to access $sf_user->getGuardUser()->getUsername() when I'm
> not logged in, but I get a fatal error.
> When I'm logged in there is no problem.
>
> I'm running on a gentoo installation, and have installed symfony
> (1.1.0-BETA3) through PEAR. and the latest sfGuardDoctrine from trunk.
>
> Thanks in advance
>
> Joe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to