exit();
}
print "Content-type: text/html\n\n";
- PutHeader("Login", undef, undef, undef, 1);
+ PutHeader("Login");
if(Param("useLDAP")) {
print "I need a legitimate LDAP username and password to continue.\n";
} else {
sub PutHeader {
- my ($title, $h1, $h2, $extra, $ignoreshutdown, $jscript) = (@_);
+ my ($title, $h1, $h2, $extra, $jscript) = (@_);
if (!defined $h1) {
$h1 = $title;
$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 "<HTML><HEAD>\n<TITLE>$title</TITLE>\n";
print Param("headerhtml") . "\n$jscript\n</HEAD>\n";
print "</TD></TR></TABLE>\n";
if (Param("shutdownhtml")) {
- if (!$ignoreshutdown) {
+ # If we are dealing with the params page, we want
+ # to ignore shutdownhtml
+ if ($0 !~ m:[\\/](do)?editparams.cgi$:) {
+ print "<p>\n";
print Param("shutdownhtml");
exit;
}
}
-PutHeader("Saving new parameters", undef, undef, undef, 1);
+PutHeader("Saving new parameters");
foreach my $i (@::param_list) {
# print "Processing $i...<BR>\n";
-PutHeader("Edit parameters", undef, undef, undef, 1);
+PutHeader("Edit parameters");
print "This lets you edit the basic operating parameters of bugzilla.\n";
print "Be careful!\n";
if ($str =~ /^LOCK TABLES/i && $str !~ /shadowlog/ && $::dbwritesallowed) {
$str =~ s/^LOCK TABLES/LOCK TABLES shadowlog WRITE, /i;
}
+ # If we are shutdown, we don't want to run queries except in special cases
+ if (Param('shutdownhtml')) {
+ if ($0 =~ m:[\\/](do)?editparams.cgi$:) {
+ $::ignorequery = 0;
+ } else {
+ $::ignorequery = 1;
+ return;
+ }
+ }
SqlLog($str);
$::currentquery = $::db->prepare($str);
$::currentquery->execute
}
sub MoreSQLData {
+ # $::ignorequery is set in SendSQL
+ if ($::ignorequery) {
+ return 0;
+ }
if (defined @::fetchahead) {
return 1;
}
}
sub FetchSQLData {
+ # $::ignorequery is set in SendSQL
+ if ($::ignorequery) {
+ return;
+ }
if (defined @::fetchahead) {
my @result = @::fetchahead;
undef @::fetchahead;
PutHeader("Bugzilla Query Page", "Query",
"This page lets you search the database for recorded bugs.",
- q{onLoad="selectProduct(document.forms[0]);"},
- 0, $jscript);
+ q{onLoad="selectProduct(document.forms[0]);"}, $jscript);
push @::legal_resolution, "---"; # Oy, what a hack.