Forums / Developer / Extending the user module

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Extending the user module

Author Message

Felix Laate

Tuesday 29 January 2008 2:42:27 pm

Hi all!

I'm looking into the possibility of extending the user module. Registering a user currently works like this:

- The user fills out a form
- The userobject is created and a verification email is sent
- The user confirms the registration

This way of doing things have two major drawbacks:

1) Sending emails from such a system can be hazardous. In my experience, on some sytems, up to a third of all such emails sent never reach their destinaton

2) It makes the registration-process difficult for dummies (which, believe it or not, make up most of the world population :-))

So what I want to do, is to do a rewrite and accomplish this:

- The user fils out a form
- A SMS is sent to the user with a 4-digit pincode
- The user enters the code and is ready to go

I had a look into the user module. It is by nature a part of the kernel, and I really don't want to mess it up. Even if a hack seems to be the quickest way to achieve things, I realy want to do this in an extension.

Is it possible to extend parts of a modue? Or do I need to make a new module, very similar to the original?

Any help is helpfull!

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Piotrek Karaś

Tuesday 29 January 2008 9:34:05 pm

My guess is that it is perfectly possible by setting up a new module extension (for example smsregister), with register view copied from the kernel and then modified according to your needs. A view is just an interface to certain system state, and I am pretty sure you can have multiple different interfaces, which are independent. You can also turn disable the standard register view without having to touch the kernel (ini).

I might be wrong here, but seems to me that a module is an abstract collection of views and fetches (and maybe some reusable parts of code), so creating a custom view for a module would actually extend module's functionality as such, but not affect anything 'in it'.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Nathan Kelly

Monday 07 April 2008 7:47:51 pm

<i>Is it possible to extend parts of a modue? Or do I need to make a new module, very similar to the original?</i>

Hi, I'm in need of a similar solution and I'm with Felix, I don't want to mess with the kernel either. Is it possible to extend parts of a module? If so can someone maybe point me to some documentation that might explain how to do this?

The changes I need to make to the registration process are rather minor so it would be great if I didn't have to recreate the entire user module for the sake of 50 odd lines of code.

Cheers.

Pardon me while I burst into flames...

Felix Laate

Monday 07 April 2008 11:54:13 pm

@Nathan,

we are currently looking into the possibility of patching kernel/user/register.php to allow for other types of handling than the default one (email). More specifically we plan to add a custom handling method, defined in an ini-file, which lets you control the registration process and thus the feedback/activation methods.

If successful, we plan to kindly request for the adoption of this enhancement into Exponential.

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

André R.

Wednesday 09 April 2008 5:20:32 am

Patch for letting you extend the user register code can be found here:
http://issues.ez.no/IssueView.php?Id=12835&activeItem=2

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Nathan Kelly

Wednesday 09 April 2008 5:44:00 am

Wow, that was a quicker response than I expected, thank André I'll check it out.

I must say it would be nice if this sort of action was possible with every core
module, I had to hack a kernel file for the browse function which simply added the
ability to specify the start node with a hidden input field in one of my
developments because the start node depended on the current user, this was a
function not achievable through ini settings and it wasn't worth developing an
entire extension for due to the fact it only needed three lines of code.

I would like to see the ability to extend all of the core modules and functions in
future versions, I think this will add yet another layer of flexibility to eZ and I
can't see it being a major issue to implement, simply add in a check if additional
functionality has been set in an extension and if so execute it within the current
action. This would basically be a plugin mechanism for core modules, the only issue
I can see would be executing multiple plugins/extra actions within one module action
instance, but you guys are pretty brainy ;).

I'll check this patch out, thanks André.

Pardon me while I burst into flames...