Add more logic to register.php

Author Message

Jeremy B.

Tuesday 28 July 2009 11:34:12 pm

Hi all,

I have to add more logic when a user register / edit his profile.

For my case, I want to save the user email in a separate table in DB when he register, in order to build a table of users that want a newsletter.
I want it in a separate table, because anonymous user will also be able to subscribe, so storing these infos in the user itself is not an option in this case.

What is the easier / smarter way to add some instructions to these actions (register + edit) ?

Thanks for your time :)

Heath

Tuesday 28 July 2009 11:59:04 pm

Hello,

It sounds like the simplest thing to do might be to add workflow event which contains conditional php logic which when assigned to the content module's publish action would add the user email address to the separate tables you describe.

Alternately you could simply create copy of the default kernel user module as a module extension. This allows you to basically create a copy and quickly modify the php to provide the additional features to do.

We've talked about this in the past [2] Remember you will need to change the module 'name' in the extension/customerExt/module/customer/module.php here is an example

$Module = array( 'name' => 'Customer management',
                 'variable_params' => true );

<i>"2. All modules need to be defined in module.ini[ModuleSettings]ModuleList[] as of 4.1, in 4.0 and earlier this was optional and module list was generated on the fly on each request (lots of file system stat calls)"</i> [3] also remember to do this or your module may not be properly recognized [3,1,0],

You may also wish to add these settings to your site.ini append file

[RoleSettings] PolicyOmitList[]=customerExt

Cheers,
Heath

[0] http://ezpedia.org/en/ez/module
[1] http://ezpedia.org/en/ez/ez_publish_4
[2] http://ez.no/developer/forum/developer/add_to_basket_multiple_products
[3] http://ez.no/developer/forum/extensions/access_denied_with_custom_extensions_after_upgrade_to_4_1
[4] http://ez.no/developer/forum/developer/passing_custom_parameters_from_shop_userregister

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Jeremy B.

Wednesday 29 July 2009 7:28:10 am

Hi Heath,

Thanks for your help, I'll take a look to the solutions you mention.
But I think I'll give a try to the "new module" thing.

Tanks a lot.

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 16:16:25
Script start
Timing: Jan 18 2025 16:16:25
Module start 'layout'
Timing: Jan 18 2025 16:16:25
Module start 'content'
Timing: Jan 18 2025 16:16:26
Module end 'content'
Timing: Jan 18 2025 16:16:26
Script end

Main resources:

Total runtime0.5777 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 589.3594152.6250
Module start 'layout' 0.00570.0027 741.984439.4453
Module start 'content' 0.00850.5678 781.4297539.6719
Module end 'content' 0.57630.0014 1,321.101612.1641
Script end 0.5777  1,333.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.5074160.0002
Check MTime0.00120.2094160.0001
Mysql Total
Database connection0.00070.116710.0007
Mysqli_queries0.529591.6607570.0093
Looping result0.00050.0810550.0000
Template Total0.551895.520.2759
Template load0.00160.273820.0008
Template processing0.550295.239220.2751
Template load and register function0.00010.022510.0001
states
state_id_array0.00060.110110.0006
state_identifier_array0.00060.095620.0003
Override
Cache load0.00130.2323310.0000
Sytem overhead
Fetch class attribute can translate value0.00070.127620.0004
Fetch class attribute name0.00090.159840.0002
XML
Image XML parsing0.00070.124420.0004
class_abstraction
Instantiating content class attribute0.00000.001740.0000
General
dbfile0.00080.1426170.0000
String conversion0.00000.003640.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs