This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » User management plugins » Create user with profile creation
Create user with profile creation [message #58303] Fri, 08 August 2008 17:22 Go to next message
kurosaki  is currently offline kurosaki
Messages: 67
Registered: August 2008
Member
Hi, I have created a profile table to extend sfGuard, but obviously when I want to create a new Profile, it will ask me for the user to make a relation.

But I want to create the Profile and the user at the same time (username and password fields in the same form).

Was this covered here before? is there any tutorial? Because I think it's not only me who want to do that.

Thanks.
Re: Create user with profile creation [message #58304 is a reply to message #58303 ] Fri, 08 August 2008 17:37 Go to previous messageGo to next message
ringhio  is currently offline ringhio
Messages: 54
Registered: August 2008
Member
I think you can create a single form to collect all data necessary to fill all the fields for user and profile.

http://www.symfony-project.org/forum/index.php/t/14819/

Than in your own action you can save all of them.

Daniel
Re: Create user with profile creation [message #58307 is a reply to message #58303 ] Fri, 08 August 2008 17:57 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
You can create an sfGuardUser module in your application, and in the actions/actions.class.php, overload the save method, call the parent (to do the save it would do normally) and then save your profile object at the same time. Works for us Smile


Remember Palestine
Re: Create user with profile creation [message #58312 is a reply to message #58307 ] Fri, 08 August 2008 18:27 Go to previous messageGo to next message
kurosaki  is currently offline kurosaki
Messages: 67
Registered: August 2008
Member
How do I do that? just create the module in CLI with the same name? (sfGuardUser)?

Regards,

Symfony n00b
Re: Create user with profile creation [message #58319 is a reply to message #58303 ] Fri, 08 August 2008 19:09 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Yep, make sure it's in the same app that you use with the plugin version of sfGuardUser. You can use the same technique to override parts of the admin generator if you include template file snippets as well (there's a list of the things you can override in the admin generator docs, but of course if you override important things it will no longer work!).


Remember Palestine
Re: Create user with profile creation [message #58538 is a reply to message #58303 ] Tue, 12 August 2008 18:49 Go to previous messageGo to next message
kurosaki  is currently offline kurosaki
Messages: 67
Registered: August 2008
Member
Hi, I created the sfGuardUser module and override the save method, there I called the parent::executeSave() method and success.

But how can I bring my profile form in the /create action (when the form of create / edit user renders).
Re: Create user with profile creation [message #58580 is a reply to message #58303 ] Wed, 13 August 2008 11:44 Go to previous message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
I am not sure what you mean by that. Do you want to merge the standard sfGuardUser edit page with your profile edit page? If so, I tried this, and without editing the sfGuardUser plugin code, I found it tricky. We've resolved this by having separate user/profile admin generators: not ideal, but not the worst thing in the world either.


Remember Palestine
Previous Topic:table/class prefix an sfGuard
Next Topic:[DONE] sfGuard - retrieve password or getter for the password in cleartext
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software