~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/apps/tos/__init__.py

  • Committer: mattgiuca
  • Date: 2008-03-09 11:48:29 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:673
Rebuilt the way Terms of Service are displayed:
    Delegated displaying TOS to util.send_terms_of_service.
    dispatch/login.py and apps/tos now call this instead of doing it
    themselves.

setup.py: Added tos_path to config options.
util.py: Added send_terms_of_service. Reads the TOS file from the configured
    location, and if it isn't there, the code itself sends a default TOS
    message to administrators (note: used to be a default file, now there IS
    NO DEFAULT TOS file. This is so that it won't get blown away upon
    reinstall).
Removed apps/tos/license.html. Now admins are expected to create their own TOS
file. It explains how to do this in the TOS if there isn't one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
def handle(req):
30
30
    """Handler for the TOS application."""
31
31
 
32
 
    # Just redirect to the app's Help page
33
 
    license_file = os.path.join(util.make_local_path("apps"),
34
 
                        "tos", "license.html")
35
 
 
36
32
    # Set request attributes
37
33
    req.content_type = "text/html"
38
34
    req.write_html_head_foot = True
45
41
""")
46
42
 
47
43
    # Print out the contents of the license file
48
 
    req.sendfile(license_file)
 
44
    util.send_terms_of_service(req)
49
45
    req.write('<hr />\n</div>\n')