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 On 5 Apr., 22:21, Christophe COEVOET <s...@notk.org> wrote: > Le 05/04/2011 21:58, pzwosta a crit : > > > > > > > > > Hi, > > > In the acme demo (PR 9) I saw: {{ app.user ? app.user.username : > > 'Anonymous' }} > > > In my php-template I found out there was a session attribute > > _security_profile that contains the username and password when the > > user is looged in but I can't find the correct way to get it > > "unserialized". The documentation talks about security.context but I > > can't find this string anywhere in the session. > > > I tried to find out whats "app" in the twig template to find out where > > "user" comes from but also didn't succeed. > > > How can I find out in a php template if the user is logged in > > (authenticated) to show the login/logout button and how can I find out > > the username? > > > Any hint is appreciated. > > the same variable is available in PHP templates: $app->getUser() > > -- > 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