Forums / Developer / Add more logic to register.php

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.

eZ debug

Timing: Jan 18 2025 11:35:10
Script start
Timing: Jan 18 2025 11:35:10
Module start 'content'
Timing: Jan 18 2025 11:35:11
Module end 'content'
Timing: Jan 18 2025 11:35:11
Script end

Main resources:

Total runtime0.8388 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 588.8281180.8359
Module start 'content' 0.00640.6814 769.6641544.7500
Module end 'content' 0.68790.1509 1,314.4141332.7500
Script end 0.8388  1,647.1641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00450.5397210.0002
Check MTime0.00200.2405210.0001
Mysql Total
Database connection0.00090.107810.0009
Mysqli_queries0.758190.37651940.0039
Looping result0.00210.25591920.0000
Template Total0.809896.520.4049
Template load0.00300.353620.0015
Template processing0.806996.187420.4034
Template load and register function0.00030.034810.0003
states
state_id_array0.00110.127710.0011
state_identifier_array0.00100.115520.0005
Override
Cache load0.00230.2778310.0001
Sytem overhead
Fetch class attribute can translate value0.00160.191530.0005
Fetch class attribute name0.00220.257140.0005
XML
Image XML parsing0.00120.145230.0004
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00370.4389280.0001
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs