register users in different user groups

Author Message

Dhaval Patel

Thursday 21 August 2008 4:34:22 am

hello all,

I want to register user in one of the different listed groups.

But i think, ez provides functionality to register user in group by setting in site.ini file.

Is that passoble that
There are three steps of registration.
step-1 list of user groups
step-2 select group from step-1 and open the registration form with the user groups in select box. user can change user group here also.
step-3 varification mail and display his profile after clicking on activation link in email.

step-3 I can make working.

so please suggest me what to do for step-1 and step-2.

Thanks a lot in advance...

Thanking you very very much

Dhaval Patel

With Best Regards,

Dhaval Patel
Team Leader - iNETProcess(I) Pvt. LTD.
dhaval.patel@inetprocess.com
Ph No: +91 79 65 12 35 00
http://www.inetprocess.co.in

Mickael Robin

Monday 06 October 2008 12:54:42 am

Hi Dhaval,

could you find a way to fulfill this need?

Otherwise, I'll try to use different siteaccesses as proposed here http://ez.no/developer/forum/setup_design/two_registration_forms_with_diferent_user_groups/re_two_registration_forms_with_diferent_user_g__4

Thanks in advance for your response,
Mickael

Dhaval Patel

Monday 06 October 2008 2:57:42 am

hi Mickael,

I have changed the /kernel/user/register.php .

The steps will be as follows.

User fills the registration fields in the registration form and also selects the group in which he wants to register.

Now open /kernel/user/register.php

find this line

$object = eZContentObject::fetch( $object->attribute( 'id' ) );

Put the below line after the above code...

// move user to specified group
eZContentObjectTreeNodeOperations::move( $object->attribute( 'main_node_id' ), $http->variable("membership") );

In this code "membership" is the field name of the group in register form.

so what I am doing is "Move user to specified group after registration."

Is this OK for you ?

With Best Regards,

Dhaval Patel
Team Leader - iNETProcess(I) Pvt. LTD.
dhaval.patel@inetprocess.com
Ph No: +91 79 65 12 35 00
http://www.inetprocess.co.in

John Smith

Tuesday 18 August 2009 1:00:59 am

Hi Dhaval,

I am in the similar situation and need bit of guidance if you can. Mate what is best way to display the drop down list on the registration form and then to pull the data in the /kernel/user/register.php. I tried by addition an attribute named as selection in the user class but bit stuck and need your help in pulling the data in /kernel/user/register.php

Have you got some code example.

Cheers

Jean-Luc Nguyen

Tuesday 18 August 2009 1:19:19 am

Hello,

Maybe you can create a publishing workflow that creates multiple locations to groups:

http://projects.ez.no/createmultiplelocationruleevent

http://www.acidre.com

Dhaval Patel

Tuesday 18 August 2009 1:35:02 am

Hi john,

I have just put hard coded combo box into register.tpl by overiding it.

<select name="group_id">
     <option value="{$group_id1}">{$group_name1}</option>
     <option value="{$group_id2}">{$group_name2}</option>
     <option value="{$group_id3}">{$group_name3}</option>
</select>

and in register.php, after creating the user, I just move that created object into group node

      $object = eZContentObject::fetch( $object->attribute( 'id' ) );
      eZContentObjectTreeNodeOperations::move( $object->attribute( 'main_node_id' ), $http->variable("group_id") );

that's all.

With Best Regards,

Dhaval Patel
Team Leader - iNETProcess(I) Pvt. LTD.
dhaval.patel@inetprocess.com
Ph No: +91 79 65 12 35 00
http://www.inetprocess.co.in

John Smith

Tuesday 18 August 2009 1:40:32 am

Hi Jean

Thanks for you kind help. Would it be possible for you to please explain me in bit more detail like how this can be useful in my requirement.

My requirement is to move users to specific user groups while they register.

Looking forward to hear from you soon.

Dhaval Patel

Tuesday 18 August 2009 1:49:09 am

hi,

if you want to allow users to select the group, put select tag into register.tpl file. where user will select the group. let us take example that user selected id=3 (group_name3)

now in register.php

put the code for move

eZContentObjectTreeNodeOperations::move( $object->attribute( 'main_node_id' ), $http->variable("group_id") );

$object denotes the created user object and $http->variable("group_id") denotes the destination group node id.

With Best Regards,

Dhaval Patel
Team Leader - iNETProcess(I) Pvt. LTD.
dhaval.patel@inetprocess.com
Ph No: +91 79 65 12 35 00
http://www.inetprocess.co.in

John Smith

Tuesday 18 August 2009 1:58:36 am

Thank you boss, you are a star, this "eZContentObjectTreeNodeOperations::move" did a trick. It is all working.

Did you get my email as well.

Keep in touch mate.

Jean-Luc Nguyen

Tuesday 18 August 2009 2:47:33 am

If this is solved, great.

Just for info, I supposed that when a new user is register, it is put under group A, as primary location. The extension I made permits to create secondary locations after publication (workflow); the user is still put under group A as primary location, and also put under group B and C (B and C are configured in a INI file) as secondary locations.

http://www.acidre.com

John Smith

Wednesday 19 August 2009 8:52:47 am

@Dhaval

Can you please confirm few things after checking the database.

If you delete the user which has been moved to the specified user group while registration process, it is leaving the row blank.

Please check ezuser table in the database.

Please confim.

Dhaval Patel

Wednesday 19 August 2009 10:11:18 pm

hello,

Its ez functionality that when you go to the create mode, ez creates blank row into database and if you cancel then only it will delete the blank row.

With Best Regards,

Dhaval Patel
Team Leader - iNETProcess(I) Pvt. LTD.
dhaval.patel@inetprocess.com
Ph No: +91 79 65 12 35 00
http://www.inetprocess.co.in

John Smith

Thursday 20 August 2009 12:34:52 am

Sorry mate..

See below, it is bug in ezPublish. Make sure you check it as well in you installations.

http://ez.no/developer/forum/general/what_ok_button_doing_in_success_tpl_seems_bug#msg190987

I dont know how to get it sorted now. Any ideas?

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 19 2025 04:33:45
Script start
Timing: Jan 19 2025 04:33:45
Module start 'layout'
Timing: Jan 19 2025 04:33:45
Module start 'content'
Timing: Jan 19 2025 04:33:46
Module end 'content'
Timing: Jan 19 2025 04:33:46
Script end

Main resources:

Total runtime1.1039 sec
Peak memory usage4,096.0000 KB
Database Queries91

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0198 590.4063152.6406
Module start 'layout' 0.01980.0046 743.046939.4766
Module start 'content' 0.02441.0782 782.5234719.7500
Module end 'content' 1.10260.0012 1,502.273424.1406
Script end 1.1038  1,526.4141 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00470.4230160.0003
Check MTime0.00150.1389160.0001
Mysql Total
Database connection0.00130.115910.0013
Mysqli_queries0.998190.4152910.0110
Looping result0.00090.0845890.0000
Template Total1.048194.920.5241
Template load0.00220.201220.0011
Template processing1.045994.745820.5229
Template load and register function0.00020.022510.0002
states
state_id_array0.00280.255410.0028
state_identifier_array0.00170.156720.0009
Override
Cache load0.00210.1914860.0000
Sytem overhead
Fetch class attribute can translate value0.00100.090240.0002
Fetch class attribute name0.00310.2837140.0002
XML
Image XML parsing0.00130.121240.0003
class_abstraction
Instantiating content class attribute0.00000.0029150.0000
General
dbfile0.00170.1570160.0001
String conversion0.00000.001440.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
13content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
20content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 44
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs