From e9d127328584062a35806bdeecb3faba6527a5dd Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Wed, 8 May 2002 11:40:33 +0000 Subject: Bug 140437 - clean up parameters. Patch by gerv; 2xr=justdave. --- CGI.pl | 103 -------------------------------------------- checksetup.pl | 14 +++++- defparams.pl | 134 +--------------------------------------------------------- globals.pl | 7 --- relogin.cgi | 2 - 5 files changed, 13 insertions(+), 247 deletions(-) diff --git a/CGI.pl b/CGI.pl index f5ce6fb35..01afc62dd 100644 --- a/CGI.pl +++ b/CGI.pl @@ -1100,109 +1100,6 @@ sub GetBugActivity { return(\@operations, $incomplete_data); } -sub GetCommandMenu { - my $loggedin = quietly_check_login(); - if (!defined $::anyvotesallowed) { - GetVersionTable(); - } - my $html = qq { -
- -}; - - #begin preset queries - my $mybugstemplate = Param("mybugstemplate"); - my %substs; - $substs{'userid'} = url_quote($::COOKIE{"Bugzilla_login"}); - $html .= ""; - $html .= ""; - $html .= "\n"; - } else { - $html .= ""; - } - $html .= "
-Actions: - -New | -Query | -}; - - if (-e "query2.cgi") { - $html .= "[beta]"; - } - - $html .= qq{ - bug \# - -| Reports -}; - if ($loggedin) { - if ($::anyvotesallowed) { - $html .= " | My votes\n"; - } - } - if ($loggedin) { - #a little mandatory SQL, used later on - SendSQL("SELECT mybugslink, userid, blessgroupset FROM profiles " . - "WHERE login_name = " . SqlQuote($::COOKIE{'Bugzilla_login'})); - my ($mybugslink, $userid, $blessgroupset) = (FetchSQLData()); - - #Begin settings - $html .= qq{ - -   - -Edit prefs -}; - if (UserInGroup("tweakparams")) { - $html .= ", parameters\n"; - } - if (UserInGroup("editusers") || $blessgroupset) { - $html .= ", users\n"; - } - if (UserInGroup("editcomponents")) { - $html .= ", products\n"; - $html .= ", - attachment statuses\n"; - } - if (UserInGroup("creategroups")) { - $html .= ", groups\n"; - } - if (UserInGroup("editkeywords")) { - $html .= ", keywords\n"; - } - if (UserInGroup("tweakparams")) { - $html .= "| Sanity check\n"; - } - - $html .= qq{ -| Log out $::COOKIE{'Bugzilla_login'} -
Preset Queries: \n"; - if ($mybugslink) { - my $mybugsurl = PerformSubsts($mybugstemplate, \%substs); - $html = $html . "My bugs\n"; - } - SendSQL("SELECT name FROM namedqueries " . - "WHERE userid = $userid AND linkinfooter"); - my $anynamedqueries = 0; - while (MoreSQLData()) { - my ($name) = (FetchSQLData()); - my $disp_name = $name; - $disp_name =~ s/ / /g; - if ($anynamedqueries || $mybugslink) { $html .= " | " } - $anynamedqueries = 1; - $html .= "$disp_name\n"; - } - $html .= "
 \n"; - $html .= - " New account\n"; - $html .= - " | Log in"; - $html .= "
"; - $html .= "
\n"; - return $html; -} ############# Live code below here (that is, not subroutine defs) ############# diff --git a/checksetup.pl b/checksetup.pl index a3aee4a7d..59d1dc14c 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -903,13 +903,23 @@ if (-e "data/params") { require "data/params"; require "defparams.pl"; use vars @::param_list; + open(PARAMFILE, ">>old-params.txt") + || die "$0: Can't open param-$item.txt for writing: $!\n"; + foreach my $item (keys %::param) { if (!grep($_ eq $item, @::param_list) && $item ne "version") { - print "The $item parameter is no longer used in Bugzilla\n" . - "and has been removed from your parameters file.\n"; + print "The $item parameter is no longer used in Bugzilla, + so it has been removed from your parameters file and + written to old-params.txt.\n"; + + print PARAMFILE "\n\n$item:\n"; + print PARAMFILE $::param{$item}; + delete $::param{$item}; } } + + close PARAMFILE; WriteParams(); } diff --git a/defparams.pl b/defparams.pl index 9189b85a7..2c6b8b889 100644 --- a/defparams.pl +++ b/defparams.pl @@ -153,17 +153,6 @@ DefParam("cookiepath", "t", "/"); -DefParam("preferlists", - "If this is on, Bugzilla will display most selection options as selection lists. If this is off, Bugzilla will use radio buttons and checkboxes instead.", - "b", - 1); - -DefParam("capitalizelists", - "If this is on, Bugzilla will capitalize list entries, checkboxes, and radio buttons. If this is off, Bugzilla will leave these items untouched.", - "b", - 0); - - 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", @@ -193,27 +182,6 @@ DefParam("queryagainstshadowdb", 0); -DefParam("usedespot", - "If this is on, then we are using the Despot system to control our database of users. Bugzilla won't ever write into the user database, it will let the Despot code maintain that. And Bugzilla will send the user over to Despot URLs if they need to change their password. Also, in that case, Bugzilla will treat the passwords stored in the database as being crypt'd, not plaintext.", - "b", - 0); - -DefParam("despotbaseurl", - "The base URL for despot. Used only if usedespot is turned on, above.", - "t", - "http://cvs-mirror.mozilla.org/webtools/despot/despot.cgi", - \&check_despotbaseurl); - - -sub check_despotbaseurl { - my ($url) = (@_); - if ($url !~ /^http.*cgi$/) { - return "must be a legal URL, that starts with http and ends with .cgi"; - } - return ""; -} - - # Adding in four parameters for LDAP authentication. -JMR, 7/28/00 DefParam("useLDAP", "Turn this on to use an LDAP directory for user authentication ". @@ -244,113 +212,18 @@ DefParam("LDAPmailattribute", #End of LDAP parameters -DefParam("headerhtml", - "Additional HTML to add to the HEAD area of documents, eg. links to stylesheets.", - "l", - ''); - -DefParam("bodyhtml", - "Additional parameters to add to the BODY tag at the beginning of documents, eg. background image/colors, link colors, etc", - "l", - 'BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000"'); - -DefParam("footerhtml", - "HTML to add to the bottom of every page. By default it displays the blurbhtml, and %commandmenu%, a menu of useful commands. You probably really want either bannerhtml or footerhtml to include %commandmenu%.", - "l", - '
- -
-%blurbhtml% -
-%commandmenu% -
'); - -DefParam("errorhtml", - "This is what is printed out when a form is improperly filled out. %errormsg% is replaced by the actual error itself; %anythingelse% gets replaced by the definition of that parameter (as defined on this page).", - "l", - qq{
-%errormsg%
-

Please press Back and try again.

}); - - - -DefParam("bannerhtml", - "The html that gets emitted at the head of every Bugzilla page. -Anything of the form %word% gets replaced by the defintion of that -word (as defined on this page).", - "l", - q{ -
-

Bugzilla version %version% -
}); - -DefParam("blurbhtml", - "A blurb that appears as part of the header of every Bugzilla page. This is a place to put brief warnings, pointers to one or two related pages, etc.", - "l", - "This is Bugzilla: the Mozilla bug system. For more -information about what Bugzilla is and what it can do, see -mozilla.org's -bug pages."); - - -DefParam("mostfreqhtml", - "The HTML which appears at the top of the list of most-frequently-reported bugs. Use it to explain the page, set a maintainer etc.", - "l", - q{ -

- -What are "most frequent bugs"? - -

The Most Frequent Bugs page lists the known open bugs which -are reported most frequently in recent builds of Mozilla. It is automatically -generated from the Bugzilla database every 24 hours, by counting the number -of direct and indirect duplicates of bugs. -This information is provided in order to assist in minimizing -the amount of duplicate bugs entered into Bugzilla which in turn cuts down -on development time. -
- -How do I use this list? - - -
-}); - DefParam("mostfreqthreshold", "The minimum number of duplicates a bug needs to show up on the most frequently reported bugs page. If you have a large database and this page takes a long time to load, try increasing this number.", "t", "2"); + DefParam("mybugstemplate", "This is the URL to use to bring up a simple 'all of my bugs' list for a user. %userid% will get replaced with the login name of a user.", "t", "buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=%userid%&emailtype1=exact&emailassigned_to1=1&emailreporter1=1"); - DefParam("shutdownhtml", "If this field is non-empty, then Bugzilla will be completely disabled and this text will be displayed instead of all the Bugzilla pages.", "l", @@ -575,11 +448,6 @@ sub check_webdotbase { return ""; } -DefParam("entryheaderhtml", - "This is a special header for the bug entry page. The text will be printed after the page header, before the bug entry form. It is meant to be a place to put pointers to intructions on how to enter bugs.", - "l", - 'Bug writing guidelines'); - DefParam("expectbigqueries", "If this is on, then we will tell mysql to set option SQL_BIG_TABLES=1 before doing queries on bugs. This will be a little slower, but one will not get the error The table ### is full for big queries that require a big temporary table.", "b", diff --git a/globals.pl b/globals.pl index d04133d10..0f0e96a69 100644 --- a/globals.pl +++ b/globals.pl @@ -1424,13 +1424,6 @@ sub Param ($) { return $::param{$value}; } - # See if it is a dynamically-determined param (can't be changed by user). - if ($value eq "commandmenu") { - return GetCommandMenu(); - } - if ($value eq "settingsmenu") { - return GetSettingsMenu(); - } # Um, maybe we haven't sourced in the params at all yet. if (stat("data/params")) { # Write down and restore the version # here. That way, we get around diff --git a/relogin.cgi b/relogin.cgi index 0d64fb71f..d3023c850 100755 --- a/relogin.cgi +++ b/relogin.cgi @@ -55,8 +55,6 @@ print "Set-Cookie: Bugzilla_login= ; path=$cookiepath; expires=Sun, 30-Jun-80 00 Set-Cookie: Bugzilla_logincookie= ; path=$cookiepath; expires=Sun, 30-Jun-80 00:00:00 GMT "; -# delete the cookie before dumping the header so that it shows the user -# as logged out if %commandmenu% is in the header delete $::COOKIE{"Bugzilla_login"}; $vars->{'title'} = "Logged Out"; -- cgit v1.2.3-24-g4f1b