Force users to see "Terms and Conditions"

Author Message

Bruce Morrison

Friday 22 January 2010 5:17:44 pm

Hi all

I'm working on a project where users must see and agree to terms and conditions before they can proceed into the site. I wondering if anyone has done this with eZ publish in an extension ( without modifying the core ) ?

My current thinking is to modify the pre_check.php (used to enter setup mode) to do this.

I know this can be done via javascript but I'm only interested in server side solutions.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Robin Muilwijk

Friday 22 January 2010 11:37:54 pm

Hi Bruce,

Would that include Anonymous users also, so basically everybody that want's to visit that site?

Problem I see is that how would the system know when someone visits a second time, that the visitor/user already checked of the terms and conditions?

-- Robin

Board member, eZ Publish Community Project Board - Member of the share.ez.no team - Key values: Openness and Innovation.

LinkedIn: http://nl.linkedin.com/in/robinmuilwijk // Twitter: http://twitter.com/i_robin // Skype: robin.muilwijk

SEBBANE Alexandre

Saturday 23 January 2010 10:10:22 am

Hi

i am working on a system where i have a 'disclaimer contentclass' and i make a operator with redirect and cookie to achieve it.

hope the idea is good

Alex

Paris, France

Bruce Morrison

Saturday 23 January 2010 4:41:37 pm

@Robin Yes, all visitors including anonymous ones need to see & agree to the T&C. As Alex noted the acceptance would be stored in a cookie and checked on each page view.

@Alex Thanks! Of course the template operator is the way to go!

The template operator will need to go in all pagelayout.tpl and overrides and not be in a cache-block. It would be nice to be to able to extend the pre_check.php via an extension as something just doesn't feel right about doing redirects from template operators.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Damien Pobel

Monday 25 January 2010 2:08:23 am

Hi Bruce,

and what about writing a pre read workflow that would check if the current user has already seen and agreed (cookie ?) the terms of usage ?

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Bruce Morrison

Monday 25 January 2010 7:57:49 pm

Hi Damien

I thought about a pre-read workflow but I believe that this would only apply to the content view. It would certianly be an option if it was trigger before all page views. The requirement is that no pages can be viewed with out first agreeing to the T&C.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Damien Pobel

Tuesday 26 January 2010 2:50:58 am

You're right, pre-read workflow are only triggered on content/view. I don't know how many views other than content/view can be used by users on your site, but if there are only a few, you can probably hack the PHP script of theses views to call the pre-read workflow. It's a bit hackish, but probably than modifying pre_check.php.

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Bruce Morrison

Tuesday 26 January 2010 6:34:08 pm

Hi Damien

I suspect there may be a lot more hacking involved going down the pre-read trigger route as all the content views as well as the user module views would have to be covered and this would involve modifying a significant number of core distribution files (effecting upgrades etc...).

The reason I mentioned pre_check.php is because it's called before all accesses allowing a single entry point and limiting the core modifications to a single file.

A powerful addition to eZ publish would be to allow code to be run before (and after) all requested module/view. This would be like before and after filters in Rails. I guess this is expanding the current workflow system to allow for system wide entry points that don't rely on the triggers defined in each module.

At this stage I suspect that the functionality will be implemented with a custom template operator that will be added to pagelayout.tpl with the presentation of the T&C & acceptance handled by a custom module. This approach should be able to be contained in an extension and not involve any core file hacking.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

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 02:47:04
Script start
Timing: Jan 18 2025 02:47:04
Module start 'layout'
Timing: Jan 18 2025 02:47:04
Module start 'content'
Timing: Jan 18 2025 02:47:04
Module end 'content'
Timing: Jan 18 2025 02:47:04
Script end

Main resources:

Total runtime0.8151 sec
Peak memory usage4,096.0000 KB
Database Queries77

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0090 589.1484152.6406
Module start 'layout' 0.00900.0061 741.789139.4766
Module start 'content' 0.01510.7986 781.2656702.3359
Module end 'content' 0.81370.0014 1,483.601624.1250
Script end 0.8150  1,507.7266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.4889160.0002
Check MTime0.00160.1966160.0001
Mysql Total
Database connection0.00140.171410.0014
Mysqli_queries0.718288.1139770.0093
Looping result0.00110.1365750.0000
Template Total0.755192.620.3776
Template load0.00230.282120.0011
Template processing0.752892.361220.3764
Template load and register function0.00010.012810.0001
states
state_id_array0.00400.493010.0040
state_identifier_array0.00170.211120.0009
Override
Cache load0.00210.2606560.0000
Sytem overhead
Fetch class attribute can translate value0.00080.098240.0002
Fetch class attribute name0.00140.1726120.0001
XML
Image XML parsing0.00720.878540.0018
class_abstraction
Instantiating content class attribute0.00000.0044160.0000
General
dbfile0.00610.7449360.0002
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
8content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
14content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 38
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs