Forums / Developer / Force users to see "Terms and Conditions"

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