diff options
author | 2005-07-28 03:01:38 +0000 | |
---|---|---|
committer | 2005-07-28 03:01:38 +0000 | |
commit | 5bd07e6b68079df8dcb23c2a6c4109c30961c488 (patch) | |
tree | b260608d45515fd934f5b6b001c9bcd5122af481 /CGI.pl | |
parent | Bug 302357: Some .cgi files ignore Param(shutdownhtml) in 2.19.x and 2.20rc1 ... (diff) | |
download | bugzilla-5bd07e6b68079df8dcb23c2a6c4109c30961c488.tar.gz bugzilla-5bd07e6b68079df8dcb23c2a6c4109c30961c488.tar.bz2 bugzilla-5bd07e6b68079df8dcb23c2a6c4109c30961c488.zip |
Bug 273767: Cannot log out when Param(shutdownhtml) is active - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wicked a=myk
Diffstat (limited to 'CGI.pl')
-rw-r--r-- | CGI.pl | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -67,15 +67,21 @@ require 'globals.pl'; use vars qw($template $vars); # If Bugzilla is shut down, do not go any further, just display a message -# to the user about the downtime. (do)editparams.cgi is exempted from -# this message, of course, since it needs to be available in order for +# to the user about the downtime and log out. (do)editparams.cgi is exempted +# from this message, of course, since it needs to be available in order for # the administrator to open Bugzilla back up. if (Param("shutdownhtml") && $0 !~ m:(^|[\\/])(do)?editparams\.cgi$:) { - $::vars->{'message'} = "shutdown"; + # For security reasons, log out users when Bugzilla is down. + # Bugzilla->login() is required to catch the logincookie, if any. + my $user = Bugzilla->login(LOGIN_OPTIONAL); + my $userid = $user->id; + Bugzilla->logout(); # Return the appropriate HTTP response headers. print Bugzilla->cgi->header(); + $::vars->{'message'} = "shutdown"; + $::vars->{'userid'} = $userid; # Generate and return an HTML message about the downtime. $::template->process("global/message.html.tmpl", $::vars) || ThrowTemplateError($::template->error()); |