Two registration forms with diferent user groups

Author Message

Martynas Bilevičius

Friday 18 July 2008 3:38:13 am

Hello, it is way to creat two registration forms with diferent user groups the user register for example i need that user can register to member or member2 gruop. Then user register with diferent forms and automaticaly must be added to member or member2 group indipent witch for user use.

Ivo Lukac

Friday 18 July 2008 3:45:19 am

Hi Martynas,

This location for creating registered users is configured in site.ini:
[UserSettings]
DefaultUserPlacement=12

So you could make additional siteaccess which will have custom usergroup ID for placement

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

James Stevens

Friday 18 July 2008 5:17:07 am

Thanks Ivo.

The DefaultUserPlacement setting is useful as i need to create users under different siteaccesses that belong to different user groups, and this should help with this.

Cheers,

Jamie

James Stevens

Friday 18 July 2008 5:24:55 am

What is the id (12) you refer to:-

DefaultUserPlacement=12

I'm assuming not a node id or object id of the user group. I can't see any other identifier when i view the user group in the User account area of the admin panel.

Thanks,

Jamie

Martynas Bilevičius

Friday 18 July 2008 5:26:10 am

Yes, how James say DefaultUserPlacement setting is useful if i need to create users under different siteaccesses, but if i need creat two different user groups in one siteaccess for example, i have ENG siteaccess and in this siteaccess i can creat one user to one group on also can creat user for another group.

Ivo Lukac

Friday 18 July 2008 5:43:03 am

James,

12 is node_id of the user group 'guest accounts' (this is default setting)

Martynas,

siteaccess has nothing to do with the user tree, you can have register form in one siteaccess placing users in specified group and use the users in another siteaccess. What you need is to make another siteaccess which is identical to the original one, modify the setting for user placement and override the register form template if it is different.

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

Martynas Bilevičius

Friday 18 July 2008 5:58:33 am

Or how to override user/register for. If i try override template i use code for exmaple,

[billboard_banner]
Source=content/view/billboard.tpl
MatchFile=billboard/banner.tpl
Subdir=templates
Match[class_identifier]=banner

I dont find how to override user/register.

So need creat two forms with two form action user/register and user/register2, but how to override user/register2 action that use siteacces2 settings DefaultUserPlacement which set not 12 for example 14.

Maybe you can give example.

thanks

Ivo Lukac

Friday 18 July 2008 6:29:55 am

AFAIK you can't override register.tpl with override.ini, but this is not the only way :)

1. create additional design directory and place register.tpl in it: design/additional/templates/user/register.tpl

2. in site.ini of the additional siteaccess configure additional design
[DesignSettings]
SiteDesign=additional
AdditionalSiteDesignList[]=your_main_design

3. clear the cache

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

Martynas Bilevičius

Friday 18 July 2008 1:37:59 pm

Thanks Ivo for quick ansver. So i creat how you say additional design directory ezwebin_site2 and put register.tpl in design/ezwebin_site2/templates/user/register.tpl. Next creat copy additional siteaccess 'eng2' and in site.ini file put
[DesignSettings]
SiteDesign=ezwebin_site2
AdditionalSiteDesignList[]=ezwebin_site

So user want register and prees link user/register in site and i see register form so what do i add more to register form ? That ez understand which site.ini file use.

Another way is if i try use somfing like user/register?type=member_group and get parameter 'member_group' in register.php set diferent DefaultUserPlacement. It is good way try to do like this ?

Also can i creat two diferent register forms for users ?

Thanks

Ivo Lukac

Saturday 19 July 2008 1:40:06 am

Sorry for not being more precise.

With http://your.site.com/user/register url you are accessing your default siteaccess and the original register.tpl
With http://your.site.com/eng2/user/register you are accessing you additional siteaccess which is using different register.tpl (and different DefaultUserPlacement setting)

All of this is a bit complicated but this is the only way how to do this that I know of. Setting the DefaultUserPlacement with GET parameter is not possible.

Cheers

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

Martynas Bilevičius

Sunday 20 July 2008 2:21:04 am

Hello, Ivo Lukac now understand how to do.

Very fanks.

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 11:11:33
Script start
Timing: Jan 18 2025 11:11:33
Module start 'layout'
Timing: Jan 18 2025 11:11:33
Module start 'content'
Timing: Jan 18 2025 11:11:34
Module end 'content'
Timing: Jan 18 2025 11:11:34
Script end

Main resources:

Total runtime0.6855 sec
Peak memory usage4,096.0000 KB
Database Queries83

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 589.1797152.6406
Module start 'layout' 0.00520.0028 741.820339.4766
Module start 'content' 0.00800.6761 781.2969673.2734
Module end 'content' 0.68410.0014 1,454.570324.1250
Script end 0.6855  1,478.6953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4517160.0002
Check MTime0.00120.1819160.0001
Mysql Total
Database connection0.00070.107710.0007
Mysqli_queries0.592086.3577830.0071
Looping result0.00140.2049810.0000
Template Total0.646294.320.3231
Template load0.00270.393920.0014
Template processing0.643593.871920.3217
Template load and register function0.00020.028910.0002
states
state_id_array0.00180.265410.0018
state_identifier_array0.00140.200220.0007
Override
Cache load0.00230.3322670.0000
Sytem overhead
Fetch class attribute can translate value0.00130.189830.0004
Fetch class attribute name0.00140.1984130.0001
XML
Image XML parsing0.00160.234630.0005
class_abstraction
Instantiating content class attribute0.00010.0078170.0000
General
dbfile0.00120.1698220.0001
String conversion0.00000.000940.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
11content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 41
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs