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.