diff options
author | Matthew Somerville <matthew@cake.ukcod.org.uk> | 2010-05-14 12:43:15 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@cake.ukcod.org.uk> | 2010-05-14 12:43:15 +0100 |
commit | 2e694bdcb7ccdbb4a41efa02d555656bd08eeaf3 (patch) | |
tree | e2e7ae70aa85b49b86a06dd8cbe1c01eceec67de | |
parent | cc5f1f9fdcd215952c5defede623f5d2298143c3 (diff) |
Logout method.
-rwxr-xr-x | web-admin/index.cgi | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/web-admin/index.cgi b/web-admin/index.cgi index 936054fe5..fd899f578 100755 --- a/web-admin/index.cgi +++ b/web-admin/index.cgi @@ -865,6 +865,21 @@ sub not_found { sub main { my $q = shift; + + my $logout = $q->param('logout'); + my $timeout = $q->param('timeout'); + if ($logout) { + if (!$timeout) { + $q->redirect('?logout=1&timeout=' + (time() + 7)); + return; + } + if (time() < $timeout) { + $q->header(-status => '401 Unauthorized'); + $q->header('-www-authenticate' => 'Basic realm="www.fixmystreet.com admin pages"'); + return; + } + } + my $page = $q->param('page'); $page = "summary" if !$page; |