2
# Copyright (C) 2007-2008 The University of Melbourne
1
# IVLE - Informatics Virtual Learning Environment
2
# Copyright (C) 2007-2009 The University of Melbourne
4
4
# This program is free software; you can redistribute it and/or modify
5
5
# it under the terms of the GNU General Public License as published by
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
# Terms of Service app
24
# (Mostly this is here for the "Help" section)
31
"""Handler for the TOS application."""
33
# Set request attributes
34
req.content_type = "text/html"
35
req.write_html_head_foot = True
38
req.write("""<div id="ivle_padding">
39
<p>When you first logged into IVLE, you agreed to the following Terms of
44
# Print out the contents of the license file
45
util.send_terms_of_service(req)
46
req.write('<hr />\n</div>\n')
18
# Author: Matt Giuca, Will Grant
20
"""View to display the Terms of Service.
22
This is mainly for the benefit of the link in ivle.webapp.help."""
25
from ivle.webapp.base.xhtml import XHTMLView
26
from ivle.webapp.base.plugins import ViewPlugin
28
class TermsOfServiceView(XHTMLView):
29
"""Static view of the Terms of Service."""
30
def authorize(self, req):
31
return req.user is not None
33
def populate(self, req, ctx):
34
ctx['text'] = ivle.util.get_terms_of_service()
36
class Plugin(ViewPlugin):
37
"""Registration for the Terms of Service plugin."""
39
('+tos', TermsOfServiceView),