Get Current SFGUARD user in the Controller

Questions relating to sfGuardPlugin or other user management plugins

Get Current SFGUARD user in the Controller

Postby scharly3 » Sat Oct 17, 2009 1:38 pm

Hi,

I'm looking for retriving curent user(plugin sfGuard) on my Actions but I doesn't succed.


Thx for your help
scharly3
Junior Member
 
Posts: 13
Joined: Sun Oct 04, 2009 9:43 pm
Location: France

Re: Get Current SFGUARD user in the Controller

Postby weaverryan » Sun Oct 18, 2009 5:57 pm

Try this:

Code: Select all
$this->getUser()->getGuardUser()


$this->getUser() returns the symfony 'sfUser' object.
It then holds the method getGuardUser() which returns the actual sfGuardUser model object for the current user.
Ryan Weaver - CEO of KnpLabs US
Offering Symfony2 training May 19th & 20th - Nasvhille, TN and June 6th & 7th - New York, NY

http://www.thatsquality.com
@weaverryan
User avatar
weaverryan
Faithful Member
 
Posts: 784
Joined: Sat Nov 10, 2007 1:50 am
Location: Nashville, TN


Return to User management plugins

Who is online

Users browsing this forum: No registered users and 1 guest