]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Patch by David Gardiner <david.gardiner@unisa.edu.au> -- added new headerhtml
authorterry%netscape.com <>
Wed, 28 Apr 1999 00:17:49 +0000 (00:17 +0000)
committerterry%netscape.com <>
Wed, 28 Apr 1999 00:17:49 +0000 (00:17 +0000)
param to allow people to customize the html put in the <HEAD> portion
of generated documents.  Also, a few other minor patches.

CGI.pl
defparams.pl
query.cgi

diff --git a/CGI.pl b/CGI.pl
index e580c1baae7a07a227f143b09f1c82772f8851c6..062d023482ba2ac79927fcefee495bc2cb14f8b3 100644 (file)
--- a/CGI.pl
+++ b/CGI.pl
@@ -220,17 +220,20 @@ sub make_options {
     my $last = "";
     my $popup = "";
     my $found = 0;
-    foreach my $item (@$src) {
-        if ($item eq "-blank-" || $item ne $last) {
-            if ($item eq "-blank-") {
-               $item = "";
-           }
-            $last = $item;
-            if ($isregexp ? $item =~ $default : $default eq $item) {
-                $popup .= "<OPTION SELECTED VALUE=\"$item\">$item";
-                $found = 1;
-            } else {
-               $popup .= "<OPTION VALUE=\"$item\">$item";
+
+    if ($src) {
+        foreach my $item (@$src) {
+            if ($item eq "-blank-" || $item ne $last) {
+                if ($item eq "-blank-") {
+                    $item = "";
+                }
+                $last = $item;
+                if ($isregexp ? $item =~ $default : $default eq $item) {
+                    $popup .= "<OPTION SELECTED VALUE=\"$item\">$item";
+                    $found = 1;
+                } else {
+                    $popup .= "<OPTION VALUE=\"$item\">$item";
+                }
             }
         }
     }
@@ -294,6 +297,9 @@ sub quietly_check_login() {
             }
         }
     }
+    if (!$loginok) {
+        delete $::COOKIE{"Bugzilla_login"};
+    }
     return $loginok;
 }
 
@@ -468,7 +474,8 @@ sub PutHeader {
        $h2 = "";
     }
 
-    print "<HTML><HEAD><TITLE>$title</TITLE></HEAD>\n";
+    print "<HTML><HEAD>\n<TITLE>$title</TITLE>\n";
+    print Param("headerhtml") . "\n</HEAD>\n";
     print "<BODY   BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\"\n";
     print "LINK=\"#0000EE\" VLINK=\"#551A8B\" ALINK=\"#FF0000\">\n";
 
index df1a06396222914ed8fe3274418ec373ddaa0ec8..9bcc9a56738cd330bcdef61d2a7f0dadcddbfc15 100644 (file)
@@ -131,6 +131,10 @@ sub check_despotbaseurl {
 }
 
 
+DefParam("headerhtml",
+         "Additional HTML to add to the HEAD area of documents, eg. links to stylesheets.",
+         "l",
+         '');
 
 
 DefParam("bannerhtml",
index f98360b661d618cfe5b82c2bad90180620b26fb6..5ee513ec0e99c2c0ffd151f275afdb91d5271826 100755 (executable)
--- a/query.cgi
+++ b/query.cgi
@@ -219,11 +219,16 @@ foreach $v (@::legal_versions) {
 
 
 for $p (@::legal_product) {
-    foreach $c (@{$::components{$p}}) {
-        $jscript .= "cpts['$c'].push('$p');\n";
+    if ($::components{$p}) {
+        foreach $c (@{$::components{$p}}) {
+            $jscript .= "cpts['$c'].push('$p');\n";
+        }
     }
-    foreach $v (@{$::versions{$p}}) {
-        $jscript .= "vers['$v'].push('$p');\n";
+
+    if ($::versions{$p}) {
+        foreach $v (@{$::versions{$p}}) {
+            $jscript .= "vers['$v'].push('$p');\n";
+        }
     }
 }