How to present content based on logged in user?

Author Message

Maarten Holland

Thursday 16 March 2006 4:59:12 am

Hi All,

I have some roles eg 'swimmer', 'footballer'. I'm writing some articles on swimming and football. When someone logs in who is a swimmer, I want them to see only articles on swimming. When a footballer logs in, he should see nothing on swimming, but only articles on football.

What's the best way to do this?

I could adjust the article class to contain a checkbox or other attribute to define if the article is on swimming or football. But as far as I know, that way I must do the filtering in template code which I think isn't the right way.

Could anyone point me in the right direction? I'm just setting up the structure so I'm open for all suggestions, it doesn't neccisarily have to be role based.

Your help is highly appreciated!

Cheers,

Maarten

Betsy Gamrat

Thursday 16 March 2006 5:44:23 am

Maarten,

I would simply organize your articles in folders and allow people to navigate through them as they wish.

Some people enjoy football and swimming.

Be sure to post some articles on biking. :)

Daniel Guerrier

Thursday 16 March 2006 7:49:01 am

You can also create you own extension and select the content according to currentUser.
http://pubsvn.ez.no/doxygen-3.5/classeZUserType.html

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 19:06:23
Script start
Timing: Jan 18 2025 19:06:23
Module start 'layout'
Timing: Jan 18 2025 19:06:23
Module start 'content'
Timing: Jan 18 2025 19:06:24
Module end 'content'
Timing: Jan 18 2025 19:06:24
Script end

Main resources:

Total runtime0.7015 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0086 588.0469152.6406
Module start 'layout' 0.00860.0028 740.687539.4922
Module start 'content' 0.01140.6886 780.1797534.5859
Module end 'content' 0.70000.0015 1,314.76568.1250
Script end 0.7015  1,322.8906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.6073160.0003
Check MTime0.00190.2674160.0001
Mysql Total
Database connection0.00170.249010.0017
Mysqli_queries0.640791.3301590.0109
Looping result0.00060.0842570.0000
Template Total0.664094.620.3320
Template load0.00220.314320.0011
Template processing0.661894.327720.3309
Template load and register function0.00020.032610.0002
states
state_id_array0.00120.168610.0012
state_identifier_array0.00120.171820.0006
Override
Cache load0.00180.2567200.0001
Sytem overhead
Fetch class attribute can translate value0.00100.142930.0003
Fetch class attribute name0.00130.186640.0003
XML
Image XML parsing0.00090.121230.0003
class_abstraction
Instantiating content class attribute0.00000.001140.0000
General
dbfile0.00090.1295160.0001
String conversion0.00000.001440.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
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs