httpauth.py, cmd-cgi.py, list.fhtml: Implement explicit logout action.
[chopwood] / cmd-cgi.py
index 6dc59ee..63253b7 100644 (file)
@@ -86,6 +86,13 @@ 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.',
   opts = [SC.Opt('partial', '-p', '--partial',