A really simple sfGuard with user profile setup
May 12th, 2010 - kaore - Symfony
When you start trying to see how something works, it’s always nice to see the thing in action and try it out in a simple environment where nothing else can interfere. In the case of this post, the subject is the sfGuard plugin and in particular how it is possible to use it together with an application specific User model. This post gives you a setup with a working sfGuard plugin in a Doctrine & symfony 1.4.4 environment. To have it work, simply decompress this file, do a symfony doctrine:build –all –and-load, configure your server to point to the project and that should be enough.
The model used in this setup is a simple list of users which can be accessed through a user module, where only the access of the show action is restricted to authenticated users. sfGuardAuth signin and signout actions & modules are also used.
Let me know if something doesn’t work as it should.
These posts where helpful:
- The readme of the plugin itself
- More details are given on this page. They are definitely worth a read (or 10).
Here is a summary of the steps taken to reach this setup at its downloadable form. The details can be found in the references given above:
- Create a project, a frontend app, a schema giving details of a User table and a user module
- Get the plugin and put it in the plugins folder
- Enable the plugin in the ProjectConfiguration.class.php file, as well as the settings.yml file of the application
- In the same settings.yml list the login module and action to be used
- In the schema.yml, modifications are made to link the User table to the sfGuard model.
- In the app.yml of the app, the User table should be set as the Profile class of the sfGuard model
- The show action of the module is secured using a config/security.yml file of the module
- The forms need to be adapted as well, an sfGuardUserForm is created to extend the PluginsfGuardUserForm, using the username and password fields only (the others don’t need to be input by the user… after that, the newly created form can be embedded in the User form using the embedRelation function… the form template of the module needs to be adapted as well to take into account these changes.
- On last little thing: signin and signout links are set in the layout, using the plugin default routes
10 Responses to “A really simple sfGuard with user profile setup”
kaore May 19th, 2010 @ 11:06
Hi Luiggi, which version of symfony are you using?
luiggi May 20th, 2010 @ 00:20
I’m using version 1.4.4. I managed to make it work copying /lib/form/sfGuardUserForm.class.php to /lib/form/doctrine/sfDoctrineGuardPlugin/sfGuardUserForm.class.php. Now it’s working but the form shows a “SfGuardUser” label next to Username and Password labels. How can i avoid showing to which table these fields belong?
kaore May 20th, 2010 @ 03:54
There was twice the same file in the zip file. I removed one. Thanks for noticing. Concerning your question, you have to work on the template of the form. As it is the template is a simple “echo $form”. To customize it you’ll have to render the form fields one by one.
Gjairlsr November 11th, 2011 @ 04:15
It’s a bad line Preteen Lolita Pussy
yaygub
Leslie April 8th, 2013 @ 16:38
Could I have , please? Lolita Porn Pics This chick is fuckin HOTTTT!!!!!
Vidthqag April 10th, 2013 @ 07:45
Where do you study? http://community.parents.com/asumouooi/blog/2013/04/04/lolita_kingdom_nude_pics free lolita kids photo What a man. He had a nice ass hole right there and he decides to jack off. She at least did a nice cumfart!
Eoxjogyx April 10th, 2013 @ 07:46
An envelope gallerie preteen incest lolitas so real it feels so good. a guy did this to me and i was orgasming for a full half hour afterwords.
Madelyn April 10th, 2013 @ 08:00
I stay at home and look after the children lolita gallery bbs list i love it when the girls are really hot and get all naked barefeet and everything i love seeing there nice tits and pussy licked and there feet too
Nathaniel April 10th, 2013 @ 08:03
I’m not sure russian loli pusy pics i want to lick her tits
Leave a Reply
RSS 2.0You can follow any responses to this entry through You can leave a response, ou trackback from your own site.



ShareThis
luiggi May 19th, 2010 @ 05:25
Hi, i tryed your code, but i get a form with all the fields from sf_guard_user table along with firstname and lastname from the user table