extending ezUser so on profile changes can be checked

Author Message

Douglas Hammond

Thursday 28 May 2009 1:10:05 pm

I have extended the login handler.

Now after a user logs in, it seems ezpublisher no longer uses my cutom user class as when I change the user info, the overrided store function does not fire.

How do I get ezPublish to use my custom user class, not just for logging in?

Paul Forsyth

Thursday 28 May 2009 2:25:08 pm

Hi Douglas,

Have a look at this extension with a login handler:

http://projects.ez.no/superuser

and compare with your own. It may highlight something with your own code.

Paul

eZ Systems

Douglas Hammond

Friday 29 May 2009 5:54:46 am

Thanks but that part I got.

It is using an extened ezUser class to override the default ezUser class that I would like to do. When the ezUser is updated or modified i wan to catch the events to do some more logic.

Seems like the only wayt to do it is to modify the kernel source of ezUser. I would hate to have to do that and miss out on any changes in the upcoming releases.

Paul Forsyth

Friday 29 May 2009 6:13:17 am

Hi Douglas,

I hear you. Yes, the login handler only covers the loginUser function, which you can see from kernel/user/login how the correct class is loaded.

You have a few options in order to keep maintenance low. You could copy the ezuser datatype into an extension but that is a high maintenance approach.

I would patch ezusertype, specifically the function 'objectAttributeContent' which loads the ezuser object. Instead you could check for your new class and use that instead. That should force the correct object to be used, and therefore the right 'store' method.

Patching, if done properly, is a perfectly acceptable technique for modifying the kernel.

It should be very easy to maintain this patch. It depends. I can't see the ezusertype::objectAttributeContent method changing much in the future...

Paul

eZ Systems

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 23:53:57
Script start
Timing: Jan 19 2025 23:53:57
Module start 'layout'
Timing: Jan 19 2025 23:53:57
Module start 'content'
Timing: Jan 19 2025 23:53:58
Module end 'content'
Timing: Jan 19 2025 23:53:58
Script end

Main resources:

Total runtime0.5047 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 589.3828152.6406
Module start 'layout' 0.00460.0023 742.023439.4766
Module start 'content' 0.00690.4963 781.5000545.5625
Module end 'content' 0.50320.0015 1,327.062512.1250
Script end 0.5047  1,339.1875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00280.5512160.0002
Check MTime0.00120.2320160.0001
Mysql Total
Database connection0.00080.150810.0008
Mysqli_queries0.455990.3150600.0076
Looping result0.00050.0939580.0000
Template Total0.484996.120.2425
Template load0.00150.298020.0008
Template processing0.483495.774820.2417
Template load and register function0.00010.019810.0001
states
state_id_array0.00020.046510.0002
state_identifier_array0.00050.100420.0003
Override
Cache load0.00130.2515260.0000
Sytem overhead
Fetch class attribute can translate value0.00050.104420.0003
Fetch class attribute name0.00090.176350.0002
XML
Image XML parsing0.00340.670420.0017
class_abstraction
Instantiating content class attribute0.00000.002060.0000
General
dbfile0.00340.6816170.0002
String conversion0.00000.001240.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 12
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs