Forums / Setup & design / Protecting content based on age

Protecting content based on age

Author Message

Nathan Sharp

Wednesday 21 February 2007 5:34:42 pm

I have the desire to have a section of my eZp site protected based on age. Basically I'd like anonymous access for 30 days, or some configurable amount, then have the content automatically become available only for registered users. Is there any provisions for this, or can anyone think of any good ways for me to implement it?

Kristof Coomans

Wednesday 21 February 2007 11:19:43 pm

Hi Nathan

Concerning the timed anonymous access: this is quite difficult to accomplish, or even impossible. There's no way you can really make this work as far as I know (cookies can be removed, IP address can be the same for different users because a proxy is used).

The protection based on age should be a little bit easier. You can add an age selection box in the user account and then use the automated user placement extension to put the different ages in different user groups (to which different policies are assigned): http://ez.no/community/contribs/workflow/automated_user_placement_for_ez_publish_3_8

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Nathan Sharp

Thursday 22 February 2007 3:47:19 am

Thanks so much for the reply! When I said "age", I meant solely the age of the article, not of my users :-) So I guess I'll keep on looking.

Thanks!
Nathan

Kristof Coomans

Thursday 22 February 2007 4:13:29 am

Hi Nathan

So I was thinking too far :-)

Maybe you can write a custom cronjob that changes the section of an article (to a section the anonymous user has read access on) once it is old enough to be released to everyone?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

eZ debug

Timing: Jan 18 2025 15:16:15
Script start
Timing: Jan 18 2025 15:16:15
Module start 'content'
Timing: Jan 18 2025 15:16:15
Module end 'content'
Timing: Jan 18 2025 15:16:15
Script end

Main resources:

Total runtime0.1056 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 588.8594180.8359
Module start 'content' 0.00490.0049 769.695393.8672
Module end 'content' 0.00970.0958 863.5625521.9297
Script end 0.1056  1,385.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00333.1613200.0002
Check MTime0.00131.2035200.0001
Mysql Total
Database connection0.00040.401310.0004
Mysqli_queries0.071267.43881410.0005
Looping result0.00090.80561390.0000
Template Total0.095690.510.0956
Template load0.00080.801710.0008
Template processing0.094789.654410.0947
Override
Cache load0.00060.579410.0006
Sytem overhead
Fetch class attribute can translate value0.00080.771510.0008
XML
Image XML parsing0.00020.230910.0002
General
dbfile0.00222.0693200.0001
String conversion0.00000.005630.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs