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.