]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 10037 - param to disable adding new quips
authorbugreport%peshkin.net <>
Sat, 17 Aug 2002 06:28:55 +0000 (06:28 +0000)
committerbugreport%peshkin.net <>
Sat, 17 Aug 2002 06:28:55 +0000 (06:28 +0000)
r=imajes, preed

defparams.pl
quips.cgi
template/en/default/list/list.html.tmpl

index 5a1abdc43212dcbb418c0035395dc3a993ff4e7f..991b8b2205556e8642561450a49d10a7521e8469 100644 (file)
@@ -259,10 +259,12 @@ DefParam("cookiepath",
   "t",
   "/");
 
-DefParam("usequip",
-        "If this is on, Bugzilla displays a silly quip at the beginning of buglists, and lets users add to the list of quips.",
-        "b",
-        1);
+DefParam("enablequips",
+        "If this is on, Bugzilla displays a silly quip at the beginning of buglists, and lets users add to the list of quips. If this is frozen, Bugzilla will display the quip but not permit new additions.",
+        "s",
+        [['on','frozen','off'], (($::param{"usequip"} || 1) ? 'on' : 'off')],
+        \&check_multi);
+
 
 # Added parameter - JMR, 2/16/00
 DefParam("usebuggroups",
index 234c2f463b229b1a4989f9559d7401d2d12a1f82..a50bbc54a84b2debdeff164cbc848d51d62c2fe9 100755 (executable)
--- a/quips.cgi
+++ b/quips.cgi
@@ -62,7 +62,13 @@ if ($action eq "add") {
         DisplayError("Please enter a quip in the text field.");
         exit();
     }
+
+    if (Param('enablequips') ne "on") {
+        ThrowUserError("This site does not permit the addition of new quips");
+        exit();
+    }
     
+
     if ($comment =~ m/</) {
         DisplayError("Sorry - for security reasons, support for HTML tags has 
                       been turned off in quips.");
index d50d54cc5d1f51d84e6e244bd61c9e12a642dc2e..65f939e6aef1b2b8190f604635818898fe787884 100644 (file)
@@ -44,7 +44,7 @@
     <p>[% query FILTER html %]</p>
   [% END %]
 
-  [% IF Param('usequip') %]
+  [% IF Param('enablequips') != 'off' %]
     [% DEFAULT quip = "Bugzilla would like to put a random quip here, but no one has entered any." %]
     <a href="quips.cgi"><i>[% quip FILTER html %]</i></a>
   [% END %]