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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 15:18:33
Script start
Timing: Jan 18 2025 15:18:33
Module start 'layout'
Timing: Jan 18 2025 15:18:33
Module start 'content'
Timing: Jan 18 2025 15:18:34
Module end 'content'
Timing: Jan 18 2025 15:18:34
Script end

Main resources:

Total runtime0.9084 sec
Peak memory usage4,096.0000 KB
Database Queries88

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0042 589.1641152.6406
Module start 'layout' 0.00420.0028 741.804739.4922
Module start 'content' 0.00700.8997 781.2969742.8594
Module end 'content' 0.90670.0016 1,524.156324.1250
Script end 0.9084  1,548.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3371160.0002
Check MTime0.00120.1373160.0001
Mysql Total
Database connection0.00060.064610.0006
Mysqli_queries0.811189.2855880.0092
Looping result0.00130.1456860.0000
Template Total0.878796.720.4394
Template load0.00230.252220.0011
Template processing0.876496.481120.4382
Template load and register function0.00010.012010.0001
states
state_id_array0.00090.102010.0009
state_identifier_array0.00120.130320.0006
Override
Cache load0.00210.2282990.0000
Sytem overhead
Fetch class attribute can translate value0.00080.091540.0002
Fetch class attribute name0.00110.1168150.0001
XML
Image XML parsing0.00320.354140.0008
class_abstraction
Instantiating content class attribute0.00000.0043210.0000
General
dbfile0.00280.3088290.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
9content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
12content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
24content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
15content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 62
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs