summaryrefslogtreecommitdiffstats
path: root/CGI.pl
diff options
context:
space:
mode:
authormyk%mozilla.org <>2002-02-03 18:27:02 +0100
committermyk%mozilla.org <>2002-02-03 18:27:02 +0100
commit0742929eb43ee5e3e67b59a9159ca416cbd0d4be (patch)
tree8a3a47b645da6d0a41e5d7220b71ec0ff1098757 /CGI.pl
parentb5aa3e4f8caa39de11efc8b8c28eeaf09f4cc9db (diff)
downloadbugzilla-0742929eb43ee5e3e67b59a9159ca416cbd0d4be.tar.gz
bugzilla-0742929eb43ee5e3e67b59a9159ca416cbd0d4be.tar.xz
Fix for bug 121747: Stops every script before it does anything else if Bugzilla is currently shut down. Also adds global template
instantiation code to globals.pl. Patch by Myk Melez <myk@mozilla.org>. r=gerv,kiko
Diffstat (limited to 'CGI.pl')
-rw-r--r--CGI.pl29
1 files changed, 19 insertions, 10 deletions
diff --git a/CGI.pl b/CGI.pl
index eb8f5f037..f99013e25 100644
--- a/CGI.pl
+++ b/CGI.pl
@@ -52,6 +52,25 @@ use CGI::Carp qw(fatalsToBrowser);
require 'globals.pl';
+# 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
+# the administrator to open Bugzilla back up.
+if (Param("shutdownhtml") && $0 !~ m:[\\/](do)?editparams.cgi$:) {
+ # The shut down message we are going to display to the user.
+ $::vars->{'title'} = "Bugzilla is Down";
+ $::vars->{'h1'} = "Bugzilla is Down";
+ $::vars->{'message'} = Param("shutdownhtml");
+
+ # Return the appropriate HTTP response headers.
+ print "Content-Type: text/html\n\n";
+
+ # Generate and return an HTML message about the downtime.
+ $::template->process("global/message.html.tmpl", $::vars)
+ || DisplayError("Template process failed: " . $::template->error());
+ exit;
+}
+
sub GeneratePersonInput {
my ($field, $required, $def_value, $extraJavaScript) = (@_);
$extraJavaScript ||= "";
@@ -1110,16 +1129,6 @@ sub PutHeader {
$extra = "";
}
$jscript ||= "";
- # If we are shutdown, we want a very basic page to give that
- # information. Also, the page title should indicate that
- # we are down.
- if (Param('shutdownhtml')) {
- $title = "Bugzilla is Down";
- $h1 = "Bugzilla is currently down";
- $h2 = "";
- $extra = "";
- $jscript = "";
- }
print qq|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">