Sorry what I wanted to say is that the user token doesn't exist while
_security_profile does.

GlobalVariables.php:

    public function getUser()
    {
        if (!$security = $this->getSecurity()) {
            return;
        }

        if (!$token = $security->getToken()) {
            return; <<<<------ returns
        }

regards Peter

On 5 Apr., 23:01, Christophe COEVOET <s...@notk.org> wrote:
> Le 05/04/2011 22:51, pzwosta a crit :> Thanks $app-getUser() and the 
> security.context exist in the container
> > but doesn't return the username though authentication was successful.
> > The username only exists in the _security_profile token of the session
> > which I don't know how to unserialize.
>
> > regards Peter
>
> $app->getUser() returns the User which is set in the Token by the
> UserProvider. So then call getUsername on this user (taking care that an
> anonymous user will return a string, not an object so you need to check
> for this before calling the method).
> You should not use the _security_profile token directly.
>
> --
> Christophe | Stof

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to