Forums / Setup & design / Two registration forms with diferent user class

Two registration forms with diferent user class

Author Message

Jan Komárek

Tuesday 11 November 2008 5:42:56 am

Hello,

I need to cretae more registration forms for more user types. Every user type have specific profile structure. Its reason for different classes for user types.

Is any way, how to do it?

Thanks for answers,
Vebloud

André R.

Tuesday 11 November 2008 6:12:13 am

Custom module/view would be the easiest I guess, copy, past and modify the current user/register view code.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Ivo Lukac

Tuesday 11 November 2008 10:46:45 am

Hello Jan,

I would setup additional siteaccess which is exactly same like the original one, except the part with user registration classes.

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Jan Komárek

Tuesday 03 February 2009 2:51:17 am

Thank for replies. But I made mistake in understanding of EZ Publish concepts and try to do think wrong way.

I still need two type of users, but not two different classes.
I need register user to two different user groups and make explanation page, where i describe two types of registration and user will chose registration which match his needs.

I think i see similart topic here, but I cant find it.

Thanks for every help.

Ivo Lukac

Tuesday 03 February 2009 8:27:04 am

Solution is the same.

Problem is not in used user class(es). It is the destination user group which you can configure only one per siteaccess (without heavy customization or kernel hacking)

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Jan Komárek

Tuesday 03 February 2009 2:39:43 pm

I think this is relatively common problem. If someone who allready done this task will be so glad to give me some code. I will be very thanksfull.

Jan Komárek

Thursday 05 February 2009 11:44:35 am

I am foll. I idnt read carefuly, especialy copy/paste part. Its realy easy.

Luca Mischiatti

Wednesday 18 March 2009 7:20:40 am

Hi! I really need to have two registration form, but I can't do it (I have ready this topic more and more without understand it!)! Could you just better explain me step-by-step how to do it?!
Thanks!

Jan Komárek

Wednesday 18 March 2009 8:03:22 am

You have to create your own extension.

Create new module.

Create new view for registration form.

Cretae new action for process registration. Its copy paste from user module. One think which have to be changed is id of the UserGroup in which will be new user created.

Luca Mischiatti

Thursday 19 March 2009 1:45:33 am

Hi Jan!
Thanks for reply!

I don't know how to make my own extension work...

I tell you what I have already done....I dont't know if it's the right way...

I have already copied a siteaccess, and I succeed in register a user in another usegroup

www.mysite.com/index.php/business/user/register > register a user in business usergroup
www.mysite.com/index.php/ita/user/register > register a user in member usergroup

Here my problem
1 - when I try to log-in a business user login failed
2 - i need to change the form (I have done a new class but I don't know how use it in the registration form).

I think I have probably made some mistake somewhere.

I explain step by step what I have done.

I created a new directory named "business" and populated it with files copied from another siteaccess

Then I modified the files:
ez/settings/override/site.ini.append.php
ez/settings/siteaccess/business/site.ini.append.php
to add this:
SiteListe[]=business
AvailableSiteAccessListe[]=business

and
[UserSettings]
DefaultUserPlacement=601 (new usergroup I have created)

Then copy and paste additional design directory in: design/business/templates/user/

replace all design/standard/user with design/business/user

grant access to all siteaccess

clear all caches

Another strange thing...in both forms the password field haven't type="password" attribute anymore (I notice it in HTML source) so I see password clean (not with ****)

Any ideas?!

Thanks!
Luca

Jan Komárek

Friday 20 March 2009 6:20:13 am

I choose diferent way. I dont say its better way, I am newbie in EZ Publish... Your way looks like better for me. But I have no idea whatrs wrong.

Try clear all caches and look if the registred user onfirmed his registration form email. Or if you enabled that user account.

Luca Mischiatti

Friday 20 March 2009 6:42:06 am

Hi!
Now I have succeed in register user in different usergroup without any problem
Just one big problem remains.

Now I want that the business registration form has custom field like "company", "company address" and so on...

I duplicate user calss under settings > class > users;
add some new text line in my new class.
My new class node is 51.

in site.ini.append.php of business siteaccess I have added UserClassID attribute.

[UserSettings]
DefaultUserPlacement=601
UserClassID=51

Upload file, clear cache, test it...but register form doesn't change...

my register.tpl template is in folder:
design/business/template/user/register.tpl

If I try to write "Hello world!" on it I see it correctly on-line.

If I try to set a global override = "51" as UserClassID also normal registration has new fields...
so I think the problem is in override file.
I already checked permission (chown and 777), everything should be right....

Any ideas?!
Thanks!
Luca