Customer Portal

Get Involved. Join the Conversation.

Topic

    Mark W
    "Accept EULA and update contact" Sample code
    Topic posted August 25, 2011 by Mark WRed Ribbon: 250+ Points, last edited January 18, 2012 
    899 Views, 1 Comment
    Title:
    "Accept EULA and update contact" Sample code
    Content:

    I'd like to build a page for a portion of our site that checks if a user has previously accepted an End User License Agreement (EULA) and if not redirects them to the EULA form for review.  The history will be tracked in a custom Contact field we have added.  My thought is to create a EULA widget to handle loading the proper EULA text and capturing the user response, as well as a verification widget to handle the security/gateway for the protected areas.

    Has anyone built something like this in CP and if so would you mind sharing your solution?

    Thanks in advance for any assistance or recommendations!

    -M

    Comment

     

    • Ernie Turner

      While I don't have any concrete examples of this being done before, I think you're approach sounds pretty good. Storing the value in a custom field and letting the user select it seems pretty straightforward.

      As for the restriction on disallowing access to certain areas, you should look into the pre_page_render hook. You could put code in there that checks the page being accessed and then looks up the custom field on the logged in contact. If it's not set, you could redirect them to the page which allows them to accept it.