chiark / gitweb /
httpauth.py: Fix stupid formatting error.
[chopwood] / cmd-cgi.py
index b06ad6a230717b28aa2d8e942ccb77fb6ce68cf1..63253b74a068924a0f1ae99f545ce3bc16b623ef 100644 (file)
@@ -58,6 +58,7 @@ def operate(what, op, services, *args, **kw):
 @CGI.subcommand('list', ['cgi-query'], 'List available accounts')
 def cmd_list_cgi():
   CGI.page('list.fhtml',
+           header = dict(pragma = 'no-cache', cache_control = 'no-cache'),
            title = 'Chopwood: accounts list',
            accts = CU.list_accounts(CU.USER),
            nonce = HA.NONCE)
@@ -84,6 +85,13 @@ def cmd_reset_cgi(services = []):
 def cmd_clear_cgi(services = []):
   operate('clear passwords', 'clear', services)
 
+@CGI.subcommand(
+  'logout', ['cgi'],
+  'Log out of the web interface.')
+def cmd_logout_cgi():
+  CGI.redirect(CGI.action('login', why = 'LOGOUT'),
+               set_cookie = HA.bake_cookie('logged-out'))
+
 @CGI.subcommand(
   'fail', ['cgi-noauth'],
   'Raise an exception, to test the error reporting machinery.',
@@ -181,7 +189,7 @@ def cmd_source_cgi():
   AGPL.source(OUT)
 
 @CGI.subcommand('source', ['cgi-noauth'], """\
-Redirect to the source code tarball (so that it's correctly named.""")
+Redirect to the source code tarball (so that it's correctly named).""")
 def cmd_sourceredirect_cgi():
   CGI.redirect(CGI.action(TARBALL))