From e9d56927daa4929f7f406c114730bb0730016602 Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" <> Date: Sat, 17 Aug 2002 06:28:55 +0000 Subject: Bug 10037 - param to disable adding new quips r=imajes, preed --- defparams.pl | 10 ++++++---- quips.cgi | 6 ++++++ template/en/default/list/list.html.tmpl | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/defparams.pl b/defparams.pl index 5a1abdc43..991b8b220 100644 --- a/defparams.pl +++ b/defparams.pl @@ -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", diff --git a/quips.cgi b/quips.cgi index 234c2f463..a50bbc54a 100755 --- 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."); diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl index d50d54cc5..65f939e6a 100644 --- a/template/en/default/list/list.html.tmpl +++ b/template/en/default/list/list.html.tmpl @@ -44,7 +44,7 @@
[% query FILTER html %]
[% 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." %] [% quip FILTER html %] [% END %] -- cgit v1.2.3-24-g4f1b