summaryrefslogtreecommitdiffstats
path: root/index.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'index.cgi')
-rwxr-xr-xindex.cgi17
1 files changed, 13 insertions, 4 deletions
diff --git a/index.cgi b/index.cgi
index 89880d163..660909452 100755
--- a/index.cgi
+++ b/index.cgi
@@ -38,12 +38,24 @@ use Bugzilla::Update;
# Check whether or not the user is logged in
my $user = Bugzilla->login(LOGIN_OPTIONAL);
+my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
+
+# And log out the user if requested. We do this first so that nothing
+# else accidentally relies on the current login.
+if ($cgi->param('logout')) {
+ Bugzilla->logout();
+ $user = Bugzilla->user;
+ $vars->{'message'} = "logged_out";
+ # Make sure that templates or other code doesn't get confused about this.
+ $cgi->delete('logout');
+}
###############################################################################
# Main Body Execution
###############################################################################
-my $cgi = Bugzilla->cgi;
# Force to use HTTPS unless Bugzilla->params->{'ssl'} equals 'never'.
# This is required because the user may want to log in from here.
if ($cgi->protocol ne 'https' && Bugzilla->params->{'sslbase'} ne ''
@@ -52,9 +64,6 @@ if ($cgi->protocol ne 'https' && Bugzilla->params->{'sslbase'} ne ''
$cgi->require_https(Bugzilla->params->{'sslbase'});
}
-my $template = Bugzilla->template;
-my $vars = {};
-
# Return the appropriate HTTP response headers.
print $cgi->header();