I thought I'd share my solution to setting up a disclaimer that any visitor of my blog must agree to before viewing posts. There are three parts: creating a guest user + setting permissions, creating a login/disclaimer block, and making the 403 screen look pretty (optional).

* * * * Step 1 * * * *
Log into the Drupal server as the administrator and go to administer -> users. Create a guest user with a password. For example, Username=guest_user and Pass=guest_pass.
Go to administer -> access control. For the guest user, copy the anonymous user's checkboxes. Now un-check all the boxes for the anonymous user. This way, no one will be able to view content unless they are logged in (or have viewed the disclaimer).

* * * * Step 2 * * * *
Below is the HTML code for a disclaimer block. I replaced '<' with '-' and '>' with '-' as well. The values of guest_name and guest_pass are from Step 1. Also, the submit value for form-submit(op) must be "Log in". It doesn't work otherwise. You can hide this though and have a generic button, like below that says "I Agree".

* * Code For Block * *
-center-
Guest login is required to view website content. By logging in you are agreeing to the disclaimer:
-br-
-br-
-font size=4-
-a href="http://www.disclaimer_link.com" target="_blank"-
View
-br-
Disclaimer
-/a-
-/font-
-br-

-form action="?q=user/login" method="post"-
-div class="user-login-block"-
-div class="form-item"-
-input type="hidden" maxlength="64" class="form-text" name="edit[name]" id="edit-name" size="15" value="guest_name" /-
-/div-
-div class="form-item"-
-input type="hidden" class="form-password" maxlength="64" name="edit[pass]" id="edit-pass" size="15" value="guest_pass" /-
-/div-
-input type="hidden" class="form-submit" name="op" value="Log in" /-
-input type="submit" value="I Agree" /-
-/div-
-/form-
-/center-
* * End Code For Block * *
It might be a good idea to configure the block and select "Show this block by default, but let individual users hide it". For each user, including the guest, you can then turn this off so they won't see it anymore.
Also, the "user_readonly" Drupal module will let you prevent the guest account from changing their information.

* * * * Step 3 * * * *
In your web-server Drupal directory, under includes, is common.inc. Make a backup of this file first before editing.
Find: "drupal_set_title(t('Access denied'));"
Replace with: "drupal_set_title(t('Welcome Visitor'));"
Find: "return t('You are not authorized to access this page.');"
Replace with: "return t('Please agree to the disclaimer to access pages. Some content may still be locked.');"

Comments

robert castelo’s picture

You could also use the Legal module to do something similar:

http://drupal.org/project/legal

Cortext Communications
Drupal Themes & Modules

------------------------------------------
Drupal Specialists: Consulting, Development & Training

Robert Castelo, CTO
Code Positive
London, United Kingdom
----