AAron nAAs

All MindsharpBlogs

AAron's SharePoint notepad

My Links

Archives

Blog Stats

My Sites

Adding a SharePoint Clickwrap (globally)

GOAL

Create a portal/site wide "clickwrap" for my SharePoint installation. Before a user views any page in the SPS portal and or WSS site, they must acknowledge and agree to the terms of service for the site.

RESEARCH

A few quick googles for sharepoint clickwrap and "click wrap" turned up nothing useful. My previous post on site-wide footer provides a solid foundation for implementing a clickwrap.

SOLUTION

Follow the procedure and code from my Adding a SharePoint footer (globally) article to install a site wide HTTP filter module. This gives us the hook for intercepting and even replacing rendered page output. The trick is to notice that something that represents a user acceptance (something persistent) and let the page output pass through unmodified. If that acceptance is missing, then show the clickwrap statement (terms of service) which should contain "Agree" and "Disagree" (decline, etc...) buttons. The filter should notice the submitted acceptance and set their persistent flag.

Some tricky spots

  • Saving acceptance data in a cookie, profile or active directory are reasonable places (with various tradeoffs).
  • Where to get the clickwrap statement is another choice: Hardcode, read from file, read from document library?!?
  • Any text and images your clickwrap statement wants to display must not require a clickwrap to view.
  • Usually only aspx files are filtered, leaving any other content non-clickwrapped.

Clickwrap Filter Module logic:

  1. When a page is requested, the user's persistent acceptance flag (ie: cookie) should be checked.
  2. If the user has already accepted, then let all content pass through the filter. Done.
  3. Is this a "postback" where the user has clicked an "Agree" button? If so, persist acceptance flag, let all content pass through the filter. Done.
  4. Is this a "postback" where the user has clicked an "Disagree" button? If so, output the "sorry you disagree text." Done.
  5. At this point the user has not accepted on previous request and and is not posting back an answer on this request.
  6. Output the clickwrap statement that includes a form with "Agree" and "Disagree" buttons. Done.

Enjoy,

-AAron

posted on Friday, June 17, 2005 1:54 PM

Feedback

# re: Adding a SharePoint Clickwrap (globally) 11/16/2005 3:23 PM AAron nAAs

I have done this, but don't know of others and I can't provide source code :-/

My solution does have some limitations that I'm trying to overcome:

1) The clickwrap is presented after the login dialog (not before).

2) The web.config entry referring to the clickwrap HttpModule assembly gets inherited to all sub-directories and virtual directories, which causes problems for globally installed web parts with wpresources, and sometimes even locally installed when wpresources is involved. The "<clear/>" directive in "<HttpModules>" appears to be a kludge which is not real inheritance, and doesn't allow a directory to remove the clickwrap assembly until after it is referenced and loaded.

--- hani wrote:

> Do you know anyone that has implemented the
> click-wrap functionality...

Title  
Name  
Url
CAPTCHA
Protected by Clearscreen.SharpHIPEnter the code you see:
Comments