1998-09-15 21:49:26 +00:00
|
|
|
#!/usr/bonsaitools/bin/perl -w
|
|
|
|
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
1998-09-01 04:21:45 +00:00
|
|
|
#
|
1999-11-01 23:33:56 +00:00
|
|
|
# The contents of this file are subject to the Mozilla Public
|
|
|
|
# License Version 1.1 (the "License"); you may not use this file
|
|
|
|
# except in compliance with the License. You may obtain a copy of
|
|
|
|
# the License at http://www.mozilla.org/MPL/
|
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed on an "AS
|
|
|
|
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
# implied. See the License for the specific language governing
|
|
|
|
# rights and limitations under the License.
|
|
|
|
#
|
1998-09-01 04:21:45 +00:00
|
|
|
# The Original Code is the Bugzilla Bug Tracking System.
|
1999-11-01 23:33:56 +00:00
|
|
|
#
|
1998-09-01 04:21:45 +00:00
|
|
|
# The Initial Developer of the Original Code is Netscape Communications
|
1999-11-01 23:33:56 +00:00
|
|
|
# Corporation. Portions created by Netscape are
|
|
|
|
# Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
# Rights Reserved.
|
|
|
|
#
|
1998-09-01 04:21:45 +00:00
|
|
|
# Contributor(s): Terry Weissman <terry@mozilla.org>
|
2002-08-11 14:12:33 +00:00
|
|
|
# J. Paul Reed <preed@sigkill.com>
|
1998-09-01 04:21:45 +00:00
|
|
|
|
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
use strict;
|
2002-04-29 19:32:29 +00:00
|
|
|
use lib ".";
|
1998-09-01 04:21:45 +00:00
|
|
|
|
2002-08-29 09:25:54 +00:00
|
|
|
use Bugzilla::Config qw(:DEFAULT :admin);
|
1998-09-01 04:21:45 +00:00
|
|
|
|
2002-08-29 09:25:54 +00:00
|
|
|
require "CGI.pl";
|
1998-09-01 04:21:45 +00:00
|
|
|
|
2002-06-17 09:39:00 +00:00
|
|
|
ConnectToDatabase();
|
1998-09-15 21:49:26 +00:00
|
|
|
confirm_login();
|
|
|
|
|
|
|
|
print "Content-type: text/html\n\n";
|
|
|
|
|
1999-03-11 16:30:54 +00:00
|
|
|
if (!UserInGroup("tweakparams")) {
|
|
|
|
print "<H1>Sorry, you aren't a member of the 'tweakparams' group.</H1>\n";
|
|
|
|
print "And so, you aren't allowed to edit the parameters.\n";
|
2000-01-14 22:35:49 +00:00
|
|
|
PutFooter();
|
1998-09-15 21:49:26 +00:00
|
|
|
exit;
|
1998-09-01 04:21:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-01-12 18:55:24 +00:00
|
|
|
|
2001-08-13 19:11:35 +00:00
|
|
|
PutHeader("Edit parameters");
|
1998-09-15 21:49:26 +00:00
|
|
|
|
|
|
|
print "This lets you edit the basic operating parameters of bugzilla.\n";
|
|
|
|
print "Be careful!\n";
|
|
|
|
print "<p>\n";
|
|
|
|
print "Any item you check Reset on will get reset to its default value.\n";
|
|
|
|
|
1998-11-20 19:18:37 +00:00
|
|
|
print "<form method=post action=doeditparams.cgi><table>\n";
|
1998-09-15 21:49:26 +00:00
|
|
|
|
1998-11-20 19:18:37 +00:00
|
|
|
my $rowbreak = "<tr><td colspan=2><hr></td></tr>";
|
1998-09-15 21:49:26 +00:00
|
|
|
print $rowbreak;
|
|
|
|
|
2002-08-29 09:25:54 +00:00
|
|
|
foreach my $i (GetParamList()) {
|
|
|
|
my $name = $i->{'name'};
|
|
|
|
my $value = Param($name);
|
|
|
|
print "<tr><th align=right valign=top>$name:</th><td>$i->{'desc'}</td></tr>\n";
|
|
|
|
print "<tr><td valign=top><input type=checkbox name=reset-$name>Reset</td><td>\n";
|
|
|
|
SWITCH: for ($i->{'type'}) {
|
2001-10-13 01:36:17 +00:00
|
|
|
/^t$/ && do {
|
2002-08-29 09:25:54 +00:00
|
|
|
print "<input size=80 name=$name value=\"" .
|
1999-01-27 21:17:10 +00:00
|
|
|
value_quote($value) . "\">\n";
|
1998-09-15 21:49:26 +00:00
|
|
|
last SWITCH;
|
2001-10-13 01:36:17 +00:00
|
|
|
};
|
|
|
|
/^l$/ && do {
|
2002-08-29 09:25:54 +00:00
|
|
|
print "<textarea wrap=hard name=$name rows=10 cols=80>" .
|
1998-09-15 21:49:26 +00:00
|
|
|
value_quote($value) . "</textarea>\n";
|
|
|
|
last SWITCH;
|
2001-10-13 01:36:17 +00:00
|
|
|
};
|
1998-09-15 21:49:26 +00:00
|
|
|
/^b$/ && do {
|
|
|
|
my $on;
|
|
|
|
my $off;
|
|
|
|
if ($value) {
|
|
|
|
$on = "checked";
|
|
|
|
$off = "";
|
1998-09-01 20:54:24 +00:00
|
|
|
} else {
|
1998-09-15 21:49:26 +00:00
|
|
|
$on = "";
|
|
|
|
$off = "checked";
|
1998-09-01 20:54:24 +00:00
|
|
|
}
|
2002-08-29 09:25:54 +00:00
|
|
|
print "<input type=radio name=$name value=1 $on>On\n";
|
|
|
|
print "<input type=radio name=$name value=0 $off>Off\n";
|
1998-09-15 21:49:26 +00:00
|
|
|
last SWITCH;
|
|
|
|
};
|
2002-08-11 14:12:33 +00:00
|
|
|
/^m$/ && do {
|
2002-08-29 09:25:54 +00:00
|
|
|
my @choices = @{$i->{'choices'}};
|
2002-08-11 14:12:33 +00:00
|
|
|
## showing 5 options seems like a nice round number; this should
|
|
|
|
## probably be configurable; if you care, file a bug ;-)
|
2002-08-29 09:25:54 +00:00
|
|
|
my $boxSize = scalar(@choices) < 5 ? scalar(@choices) : 5;
|
2002-08-11 14:12:33 +00:00
|
|
|
|
2002-08-29 09:25:54 +00:00
|
|
|
print "<select multiple size=\"$boxSize\" name=\"$name\">\n";
|
2002-08-11 14:12:33 +00:00
|
|
|
|
2002-08-29 09:25:54 +00:00
|
|
|
foreach my $item (@choices) {
|
2002-08-11 14:12:33 +00:00
|
|
|
my $selected = "";
|
|
|
|
|
2002-08-29 09:25:54 +00:00
|
|
|
if (lsearch($value, $item) >= 0) {
|
|
|
|
$selected = "selected";
|
2002-08-11 14:12:33 +00:00
|
|
|
}
|
|
|
|
|
2002-08-29 09:25:54 +00:00
|
|
|
print "<option $selected value=\"" . html_quote($item) . "\">" .
|
|
|
|
html_quote($item) . "</option>\n";
|
2002-08-11 14:12:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
print "</select>\n";
|
|
|
|
last SWITCH;
|
|
|
|
};
|
|
|
|
/^s$/ && do {
|
2002-08-29 09:25:54 +00:00
|
|
|
print "<select name=\"$name\">\n";
|
|
|
|
my @choices = @{$i->{'choices'}};
|
2002-08-11 14:12:33 +00:00
|
|
|
|
2002-08-29 09:25:54 +00:00
|
|
|
foreach my $item (@choices) {
|
2002-08-11 14:12:33 +00:00
|
|
|
my $selected = "";
|
2002-08-29 09:25:54 +00:00
|
|
|
|
|
|
|
if ($value eq $item) {
|
2002-08-11 14:12:33 +00:00
|
|
|
$selected = "selected";
|
|
|
|
}
|
|
|
|
|
2002-08-29 09:25:54 +00:00
|
|
|
print "<option $selected value=\"" . html_quote($item) . "\">" .
|
|
|
|
html_quote($item) . "</option>\n";
|
|
|
|
|
2002-08-11 14:12:33 +00:00
|
|
|
}
|
|
|
|
print "</select>\n";
|
|
|
|
last SWITCH;
|
|
|
|
};
|
1998-09-15 21:49:26 +00:00
|
|
|
# DEFAULT
|
2002-08-29 09:25:54 +00:00
|
|
|
print "<font color=red><blink>Unknown param type $i->{'type'}!!!</blink></font>\n";
|
1998-09-01 04:21:45 +00:00
|
|
|
}
|
1998-09-15 21:49:26 +00:00
|
|
|
print "</td></tr>\n";
|
|
|
|
print $rowbreak;
|
1998-09-01 04:21:45 +00:00
|
|
|
}
|
|
|
|
|
1998-11-20 19:18:37 +00:00
|
|
|
print "<tr><th align=right valign=top>version:</th><td>
|
2002-08-29 09:25:54 +00:00
|
|
|
What version of Bugzilla this is. This can't be modified.
|
|
|
|
<tr><td></td><td>" . $Bugzilla::Config::VERSION . "</td></tr>";
|
1998-09-19 05:48:09 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
print "</table>\n";
|
1998-09-01 04:21:45 +00:00
|
|
|
|
1998-11-20 19:18:37 +00:00
|
|
|
print "<input type=reset value=\"Reset form\"><br>\n";
|
|
|
|
print "<input type=submit value=\"Submit changes\">\n";
|
1998-09-01 04:21:45 +00:00
|
|
|
|
1998-09-15 21:49:26 +00:00
|
|
|
print "</form>\n";
|
1998-09-01 04:21:45 +00:00
|
|
|
|
1998-11-20 19:18:37 +00:00
|
|
|
print "<p><a href=query.cgi>Skip all this, and go back to the query page</a>\n";
|
2000-01-14 22:35:49 +00:00
|
|
|
PutFooter();
|