aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Config')
-rw-r--r--Bugzilla/Config/Admin.pm63
-rw-r--r--Bugzilla/Config/Advanced.pm67
-rw-r--r--Bugzilla/Config/Attachment.pm91
-rw-r--r--Bugzilla/Config/Auth.pm128
-rw-r--r--Bugzilla/Config/BugChange.pm103
-rw-r--r--Bugzilla/Config/BugFields.pm120
-rw-r--r--Bugzilla/Config/Common.pm461
-rw-r--r--Bugzilla/Config/Core.pm68
-rw-r--r--Bugzilla/Config/DependencyGraph.pm52
-rw-r--r--Bugzilla/Config/General.pm83
-rw-r--r--Bugzilla/Config/GroupSecurity.pm102
-rw-r--r--Bugzilla/Config/LDAP.pm87
-rw-r--r--Bugzilla/Config/MTA.pm102
-rw-r--r--Bugzilla/Config/PatchViewer.pm75
-rw-r--r--Bugzilla/Config/Query.pm80
-rw-r--r--Bugzilla/Config/RADIUS.pm60
-rw-r--r--Bugzilla/Config/ShadowDB.pm73
-rw-r--r--Bugzilla/Config/UserMatch.pm64
18 files changed, 1879 insertions, 0 deletions
diff --git a/Bugzilla/Config/Admin.pm b/Bugzilla/Config/Admin.pm
new file mode 100644
index 000000000..e6141cf9e
--- /dev/null
+++ b/Bugzilla/Config/Admin.pm
@@ -0,0 +1,63 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::Admin;
+
+use strict;
+
+use Bugzilla::Config::Common;
+
+our $sortkey = 200;
+
+sub get_param_list {
+ my $class = shift;
+ my @param_list = (
+ {
+ name => 'allowbugdeletion',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'allowemailchange',
+ type => 'b',
+ default => 1
+ },
+
+ {
+ name => 'allowuserdeletion',
+ type => 'b',
+ default => 0
+ });
+ return @param_list;
+}
+
+1;
diff --git a/Bugzilla/Config/Advanced.pm b/Bugzilla/Config/Advanced.pm
new file mode 100644
index 000000000..faab6bbbd
--- /dev/null
+++ b/Bugzilla/Config/Advanced.pm
@@ -0,0 +1,67 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+# Max Kanat-Alexander <mkanat@bugzilla.org>
+
+package Bugzilla::Config::Advanced;
+use strict;
+
+use Bugzilla::Config::Common;
+
+our $sortkey = 1700;
+
+use constant get_param_list => (
+ {
+ name => 'cookiedomain',
+ type => 't',
+ default => ''
+ },
+
+ {
+ name => 'inbound_proxies',
+ type => 't',
+ default => ''
+ },
+
+ {
+ name => 'proxy_url',
+ type => 't',
+ default => ''
+ },
+
+ {
+ name => 'strict_transport_security',
+ type => 's',
+ choices => ['off', 'this_domain_only', 'include_subdomains'],
+ default => 'off',
+ checker => \&check_multi
+ },
+);
+
+1;
diff --git a/Bugzilla/Config/Attachment.pm b/Bugzilla/Config/Attachment.pm
new file mode 100644
index 000000000..ed4c4e459
--- /dev/null
+++ b/Bugzilla/Config/Attachment.pm
@@ -0,0 +1,91 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::Attachment;
+
+use strict;
+
+use Bugzilla::Config::Common;
+
+our $sortkey = 400;
+
+sub get_param_list {
+ my $class = shift;
+ my @param_list = (
+ {
+ name => 'allow_attachment_display',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'attachment_base',
+ type => 't',
+ default => '',
+ checker => \&check_urlbase
+ },
+
+ {
+ name => 'allow_attachment_deletion',
+ type => 'b',
+ default => 0
+ },
+ {
+ name => 'allow_attach_url',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'maxattachmentsize',
+ type => 't',
+ default => '1000',
+ checker => \&check_maxattachmentsize
+ },
+
+ # The maximum size (in bytes) for patches and non-patch attachments.
+ # The default limit is 1000KB, which is 24KB less than mysql's default
+ # maximum packet size (which determines how much data can be sent in a
+ # single mysql packet and thus how much data can be inserted into the
+ # database) to provide breathing space for the data in other fields of
+ # the attachment record as well as any mysql packet overhead (I don't
+ # know of any, but I suspect there may be some.)
+
+ {
+ name => 'maxlocalattachment',
+ type => 't',
+ default => '0',
+ checker => \&check_numeric
+ } );
+ return @param_list;
+}
+
+1;
diff --git a/Bugzilla/Config/Auth.pm b/Bugzilla/Config/Auth.pm
new file mode 100644
index 000000000..c7d921ed5
--- /dev/null
+++ b/Bugzilla/Config/Auth.pm
@@ -0,0 +1,128 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::Auth;
+
+use strict;
+
+use Bugzilla::Config::Common;
+
+our $sortkey = 300;
+
+sub get_param_list {
+ my $class = shift;
+ my @param_list = (
+ {
+ name => 'auth_env_id',
+ type => 't',
+ default => '',
+ },
+
+ {
+ name => 'auth_env_email',
+ type => 't',
+ default => '',
+ },
+
+ {
+ name => 'auth_env_realname',
+ type => 't',
+ default => '',
+ },
+
+ # XXX in the future:
+ #
+ # user_verify_class and user_info_class should have choices gathered from
+ # whatever sits in their respective directories
+ #
+ # rather than comma-separated lists, these two should eventually become
+ # arrays, but that requires alterations to editparams first
+
+ {
+ name => 'user_info_class',
+ type => 's',
+ choices => [ 'CGI', 'Env', 'Env,CGI' ],
+ default => 'CGI',
+ checker => \&check_multi
+ },
+
+ {
+ name => 'user_verify_class',
+ type => 'o',
+ choices => [ 'DB', 'RADIUS', 'LDAP' ],
+ default => 'DB',
+ checker => \&check_user_verify_class
+ },
+
+ {
+ name => 'rememberlogin',
+ type => 's',
+ choices => ['on', 'defaulton', 'defaultoff', 'off'],
+ default => 'on',
+ checker => \&check_multi
+ },
+
+ {
+ name => 'requirelogin',
+ type => 'b',
+ default => '0'
+ },
+
+ {
+ name => 'emailregexp',
+ type => 't',
+ default => q:^[\\w\\.\\+\\-=]+@[\\w\\.\\-]+\\.[\\w\\-]+$:,
+ checker => \&check_regexp
+ },
+
+ {
+ name => 'emailregexpdesc',
+ type => 'l',
+ default => 'A legal address must contain exactly one \'@\', and at least ' .
+ 'one \'.\' after the @.'
+ },
+
+ {
+ name => 'emailsuffix',
+ type => 't',
+ default => ''
+ },
+
+ {
+ name => 'createemailregexp',
+ type => 't',
+ default => q:.*:,
+ checker => \&check_regexp
+ } );
+ return @param_list;
+}
+
+1;
diff --git a/Bugzilla/Config/BugChange.pm b/Bugzilla/Config/BugChange.pm
new file mode 100644
index 000000000..4e197c5e9
--- /dev/null
+++ b/Bugzilla/Config/BugChange.pm
@@ -0,0 +1,103 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::BugChange;
+
+use strict;
+
+use Bugzilla::Config::Common;
+use Bugzilla::Status;
+
+our $sortkey = 500;
+
+sub get_param_list {
+ my $class = shift;
+
+ # Hardcoded bug statuses which existed before Bugzilla 3.1.
+ my @closed_bug_statuses = ('RESOLVED', 'VERIFIED', 'CLOSED');
+
+ # If we are upgrading from 3.0 or older, bug statuses are not customisable
+ # and bug_status.is_open is not yet defined (hence the eval), so we use
+ # the bug statuses above as they are still hardcoded.
+ eval {
+ my @current_closed_states = map {$_->name} closed_bug_statuses();
+ # If no closed state was found, use the default list above.
+ @closed_bug_statuses = @current_closed_states if scalar(@current_closed_states);
+ };
+
+ my @param_list = (
+ {
+ name => 'duplicate_or_move_bug_status',
+ type => 's',
+ choices => \@closed_bug_statuses,
+ default => $closed_bug_statuses[0],
+ checker => \&check_bug_status
+ },
+
+ {
+ name => 'letsubmitterchoosepriority',
+ type => 'b',
+ default => 1
+ },
+
+ {
+ name => 'letsubmitterchoosemilestone',
+ type => 'b',
+ default => 1
+ },
+
+ {
+ name => 'musthavemilestoneonaccept',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'commentonchange_resolution',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'commentonduplicate',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'noresolveonopenblockers',
+ type => 'b',
+ default => 0,
+ } );
+ return @param_list;
+}
+
+1;
diff --git a/Bugzilla/Config/BugFields.pm b/Bugzilla/Config/BugFields.pm
new file mode 100644
index 000000000..d0de9dac6
--- /dev/null
+++ b/Bugzilla/Config/BugFields.pm
@@ -0,0 +1,120 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::BugFields;
+
+use strict;
+
+use Bugzilla::Config::Common;
+use Bugzilla::Field;
+
+our $sortkey = 600;
+
+sub get_param_list {
+ my $class = shift;
+
+ my @legal_priorities = @{get_legal_field_values('priority')};
+ my @legal_severities = @{get_legal_field_values('bug_severity')};
+ my @legal_platforms = @{get_legal_field_values('rep_platform')};
+ my @legal_OS = @{get_legal_field_values('op_sys')};
+
+ my @param_list = (
+ {
+ name => 'useclassification',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'usetargetmilestone',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'useqacontact',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'usestatuswhiteboard',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'usebugaliases',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'use_see_also',
+ type => 'b',
+ default => 1
+ },
+
+ {
+ name => 'defaultpriority',
+ type => 's',
+ choices => \@legal_priorities,
+ default => $legal_priorities[-1],
+ checker => \&check_priority
+ },
+
+ {
+ name => 'defaultseverity',
+ type => 's',
+ choices => \@legal_severities,
+ default => $legal_severities[-1],
+ checker => \&check_severity
+ },
+
+ {
+ name => 'defaultplatform',
+ type => 's',
+ choices => ['', @legal_platforms],
+ default => '',
+ checker => \&check_platform
+ },
+
+ {
+ name => 'defaultopsys',
+ type => 's',
+ choices => ['', @legal_OS],
+ default => '',
+ checker => \&check_opsys
+ } );
+ return @param_list;
+}
+
+1;
diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm
new file mode 100644
index 000000000..9fffe02ee
--- /dev/null
+++ b/Bugzilla/Config/Common.pm
@@ -0,0 +1,461 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+# Marc Schumann <wurblzap@gmail.com>
+#
+
+package Bugzilla::Config::Common;
+
+use strict;
+
+use Email::Address;
+use Socket;
+
+use Bugzilla::Util;
+use Bugzilla::Constants;
+use Bugzilla::Field;
+use Bugzilla::Group;
+use Bugzilla::Status;
+
+use base qw(Exporter);
+@Bugzilla::Config::Common::EXPORT =
+ qw(check_multi check_numeric check_regexp check_url check_group
+ check_sslbase check_priority check_severity check_platform
+ check_opsys check_shadowdb check_urlbase check_webdotbase
+ check_user_verify_class
+ check_mail_delivery_method check_notification check_utf8
+ check_bug_status check_smtp_auth check_theschwartz_available
+ check_maxattachmentsize check_email
+);
+
+# Checking functions for the various values
+
+sub check_multi {
+ my ($value, $param) = (@_);
+
+ if ($param->{'type'} eq "s") {
+ unless (scalar(grep {$_ eq $value} (@{$param->{'choices'}}))) {
+ return "Invalid choice '$value' for single-select list param '$param->{'name'}'";
+ }
+
+ return "";
+ }
+ elsif ($param->{'type'} eq 'm' || $param->{'type'} eq 'o') {
+ foreach my $chkParam (split(',', $value)) {
+ unless (scalar(grep {$_ eq $chkParam} (@{$param->{'choices'}}))) {
+ return "Invalid choice '$chkParam' for multi-select list param '$param->{'name'}'";
+ }
+ }
+
+ return "";
+ }
+ else {
+ return "Invalid param type '$param->{'type'}' for check_multi(); " .
+ "contact your Bugzilla administrator";
+ }
+}
+
+sub check_numeric {
+ my ($value) = (@_);
+ if ($value !~ /^[0-9]+$/) {
+ return "must be a numeric value";
+ }
+ return "";
+}
+
+sub check_regexp {
+ my ($value) = (@_);
+ eval { qr/$value/ };
+ return $@;
+}
+
+sub check_email {
+ my ($value) = @_;
+ if ($value !~ $Email::Address::mailbox) {
+ return "must be a valid email address.";
+ }
+ return "";
+}
+
+sub check_sslbase {
+ my $url = shift;
+ if ($url ne '') {
+ if ($url !~ m#^https://([^/]+).*/$#) {
+ return "must be a legal URL, that starts with https and ends with a slash.";
+ }
+ my $host = $1;
+ # Fall back to port 443 if for some reason getservbyname() fails.
+ my $port = getservbyname('https', 'tcp') || 443;
+ if ($host =~ /^(.+):(\d+)$/) {
+ $host = $1;
+ $port = $2;
+ }
+ local *SOCK;
+ my $proto = getprotobyname('tcp');
+ socket(SOCK, PF_INET, SOCK_STREAM, $proto);
+ my $iaddr = inet_aton($host) || return "The host $host cannot be resolved";
+ my $sin = sockaddr_in($port, $iaddr);
+ if (!connect(SOCK, $sin)) {
+ return "Failed to connect to $host:$port; unable to enable SSL";
+ }
+ close(SOCK);
+ }
+ return "";
+}
+
+sub check_utf8 {
+ my $utf8 = shift;
+ # You cannot turn off the UTF-8 parameter if you've already converted
+ # your tables to utf-8.
+ my $dbh = Bugzilla->dbh;
+ if ($dbh->isa('Bugzilla::DB::Mysql') && $dbh->bz_db_is_utf8 && !$utf8) {
+ return "You cannot disable UTF-8 support, because your MySQL database"
+ . " is encoded in UTF-8";
+ }
+ return "";
+}
+
+sub check_priority {
+ my ($value) = (@_);
+ my $legal_priorities = get_legal_field_values('priority');
+ if (!grep($_ eq $value, @$legal_priorities)) {
+ return "Must be a legal priority value: one of " .
+ join(", ", @$legal_priorities);
+ }
+ return "";
+}
+
+sub check_severity {
+ my ($value) = (@_);
+ my $legal_severities = get_legal_field_values('bug_severity');
+ if (!grep($_ eq $value, @$legal_severities)) {
+ return "Must be a legal severity value: one of " .
+ join(", ", @$legal_severities);
+ }
+ return "";
+}
+
+sub check_platform {
+ my ($value) = (@_);
+ my $legal_platforms = get_legal_field_values('rep_platform');
+ if (!grep($_ eq $value, '', @$legal_platforms)) {
+ return "Must be empty or a legal platform value: one of " .
+ join(", ", @$legal_platforms);
+ }
+ return "";
+}
+
+sub check_opsys {
+ my ($value) = (@_);
+ my $legal_OS = get_legal_field_values('op_sys');
+ if (!grep($_ eq $value, '', @$legal_OS)) {
+ return "Must be empty or a legal operating system value: one of " .
+ join(", ", @$legal_OS);
+ }
+ return "";
+}
+
+sub check_bug_status {
+ my $bug_status = shift;
+ my @closed_bug_statuses = map {$_->name} closed_bug_statuses();
+ if (!grep($_ eq $bug_status, @closed_bug_statuses)) {
+ return "Must be a valid closed status: one of " . join(', ', @closed_bug_statuses);
+ }
+ return "";
+}
+
+sub check_group {
+ my $group_name = shift;
+ return "" unless $group_name;
+ my $group = new Bugzilla::Group({'name' => $group_name});
+ unless (defined $group) {
+ return "Must be an existing group name";
+ }
+ return "";
+}
+
+sub check_shadowdb {
+ my ($value) = (@_);
+ $value = trim($value);
+ if ($value eq "") {
+ return "";
+ }
+
+ if (!Bugzilla->params->{'shadowdbhost'}) {
+ return "You need to specify a host when using a shadow database";
+ }
+
+ # Can't test existence of this because ConnectToDatabase uses the param,
+ # but we can't set this before testing....
+ # This can really only be fixed after we can use the DBI more openly
+ return "";
+}
+
+sub check_urlbase {
+ my ($url) = (@_);
+ if ($url && $url !~ m:^http.*/$:) {
+ return "must be a legal URL, that starts with http and ends with a slash.";
+ }
+ return "";
+}
+
+sub check_url {
+ my ($url) = (@_);
+ return '' if $url eq ''; # Allow empty URLs
+ if ($url !~ m:/$:) {
+ return 'must be a legal URL, absolute or relative, ending with a slash.';
+ }
+ return '';
+}
+
+sub check_webdotbase {
+ my ($value) = (@_);
+ $value = trim($value);
+ if ($value eq "") {
+ return "";
+ }
+ if($value !~ /^https?:/) {
+ if(! -x $value) {
+ return "The file path \"$value\" is not a valid executable. Please specify the complete file path to 'dot' if you intend to generate graphs locally.";
+ }
+ # Check .htaccess allows access to generated images
+ my $webdotdir = bz_locations()->{'webdotdir'};
+ if(-e "$webdotdir/.htaccess") {
+ open HTACCESS, "$webdotdir/.htaccess";
+ if(! grep(/ \\\.png\$/,<HTACCESS>)) {
+ return "Dependency graph images are not accessible.\nAssuming that you have not modified the file, delete $webdotdir/.htaccess and re-run checksetup.pl to rectify.\n";
+ }
+ close HTACCESS;
+ }
+ }
+ return "";
+}
+
+sub check_user_verify_class {
+ # doeditparams traverses the list of params, and for each one it checks,
+ # then updates. This means that if one param checker wants to look at
+ # other params, it must be below that other one. So you can't have two
+ # params mutually dependent on each other.
+ # This means that if someone clears the LDAP config params after setting
+ # the login method as LDAP, we won't notice, but all logins will fail.
+ # So don't do that.
+
+ my $params = Bugzilla->params;
+ my ($list, $entry) = @_;
+ $list || return 'You need to specify at least one authentication mechanism';
+ for my $class (split /,\s*/, $list) {
+ my $res = check_multi($class, $entry);
+ return $res if $res;
+ if ($class eq 'RADIUS') {
+ if (!Bugzilla->feature('auth_radius')) {
+ return "RADIUS support is not available. Run checksetup.pl"
+ . " for more details";
+ }
+ return "RADIUS servername (RADIUS_server) is missing"
+ if !$params->{"RADIUS_server"};
+ return "RADIUS_secret is empty" if !$params->{"RADIUS_secret"};
+ }
+ elsif ($class eq 'LDAP') {
+ if (!Bugzilla->feature('auth_ldap')) {
+ return "LDAP support is not available. Run checksetup.pl"
+ . " for more details";
+ }
+ return "LDAP servername (LDAPserver) is missing"
+ if !$params->{"LDAPserver"};
+ return "LDAPBaseDN is empty" if !$params->{"LDAPBaseDN"};
+ }
+ }
+ return "";
+}
+
+sub check_mail_delivery_method {
+ my $check = check_multi(@_);
+ return $check if $check;
+ my $mailer = shift;
+ if ($mailer eq 'sendmail' and ON_WINDOWS) {
+ # look for sendmail.exe
+ return "Failed to locate " . SENDMAIL_EXE
+ unless -e SENDMAIL_EXE;
+ }
+ return "";
+}
+
+sub check_maxattachmentsize {
+ my $check = check_numeric(@_);
+ return $check if $check;
+ my $size = shift;
+ my $dbh = Bugzilla->dbh;
+ if ($dbh->isa('Bugzilla::DB::Mysql')) {
+ my (undef, $max_packet) = $dbh->selectrow_array(
+ q{SHOW VARIABLES LIKE 'max\_allowed\_packet'});
+ my $byte_size = $size * 1024;
+ if ($max_packet < $byte_size) {
+ return "You asked for a maxattachmentsize of $byte_size bytes,"
+ . " but the max_allowed_packet setting in MySQL currently"
+ . " only allows packets up to $max_packet bytes";
+ }
+ }
+ return "";
+}
+
+sub check_notification {
+ my $option = shift;
+ my @current_version =
+ (BUGZILLA_VERSION =~ m/^(\d+)\.(\d+)(?:(rc|\.)(\d+))?\+?$/);
+ if ($current_version[1] % 2 && $option eq 'stable_branch_release') {
+ return "You are currently running a development snapshot, and so your " .
+ "installation is not based on a branch. If you want to be notified " .
+ "about the next stable release, you should select " .
+ "'latest_stable_release' instead";
+ }
+ if ($option ne 'disabled' && !Bugzilla->feature('updates')) {
+ return "Some Perl modules are missing to get notifications about " .
+ "new releases. See the output of checksetup.pl for more information";
+ }
+ return "";
+}
+
+sub check_smtp_auth {
+ my $username = shift;
+ if ($username and !Bugzilla->feature('smtp_auth')) {
+ return "SMTP Authentication is not available. Run checksetup.pl for"
+ . " more details";
+ }
+ return "";
+}
+
+sub check_theschwartz_available {
+ my $use_queue = shift;
+ if ($use_queue && !Bugzilla->feature('jobqueue')) {
+ return "Using the job queue requires that you have certain Perl"
+ . " modules installed. See the output of checksetup.pl"
+ . " for more information";
+ }
+ return "";
+}
+
+# OK, here are the parameter definitions themselves.
+#
+# Each definition is a hash with keys:
+#
+# name - name of the param
+# desc - description of the param (for editparams.cgi)
+# type - see below
+# choices - (optional) see below
+# default - default value for the param
+# checker - (optional) checking function for validating parameter entry
+# It is called with the value of the param as the first arg and a
+# reference to the param's hash as the second argument
+#
+# The type value can be one of the following:
+#
+# t -- A short text entry field (suitable for a single line)
+# p -- A short text entry field (as with type = 't'), but the string is
+# replaced by asterisks (appropriate for passwords)
+# l -- A long text field (suitable for many lines)
+# b -- A boolean value (either 1 or 0)
+# m -- A list of values, with many selectable (shows up as a select box)
+# To specify the list of values, make the 'choices' key be an array
+# reference of the valid choices. The 'default' key should be a string
+# with a list of selected values (as a comma-separated list), i.e.:
+# {
+# name => 'multiselect',
+# desc => 'A list of options, choose many',
+# type => 'm',
+# choices => [ 'a', 'b', 'c', 'd' ],
+# default => [ 'a', 'd' ],
+# checker => \&check_multi
+# }
+#
+# Here, 'a' and 'd' are the default options, and the user may pick any
+# combination of a, b, c, and d as valid options.
+#
+# &check_multi should always be used as the param verification function
+# for list (single and multiple) parameter types.
+#
+# o -- A list of values, orderable, and with many selectable (shows up as a
+# JavaScript-enhanced select box if JavaScript is enabled, and a text
+# entry field if not)
+# Set up in the same way as type m.
+#
+# s -- A list of values, with one selectable (shows up as a select box)
+# To specify the list of values, make the 'choices' key be an array
+# reference of the valid choices. The 'default' key should be one of
+# those values, i.e.:
+# {
+# name => 'singleselect',
+# desc => 'A list of options, choose one',
+# type => 's',
+# choices => [ 'a', 'b', 'c' ],
+# default => 'b',
+# checker => \&check_multi
+# }
+#
+# Here, 'b' is the default option, and 'a' and 'c' are other possible
+# options, but only one at a time!
+#
+# &check_multi should always be used as the param verification function
+# for list (single and multiple) parameter types.
+
+sub get_param_list {
+ return;
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Bugzilla::Config::Common - Parameter checking functions
+
+=head1 DESCRIPTION
+
+All parameter checking functions are called with two parameters: the value to
+check, and a hash with the details of the param (type, default etc.) as defined
+in the relevant F<Bugzilla::Config::*> package.
+
+=head2 Functions
+
+=over
+
+=item C<check_multi>
+
+Checks that a multi-valued parameter (ie types C<s>, C<o> or C<m>) satisfies
+its contraints.
+
+=item C<check_numeric>
+
+Checks that the value is a valid number
+
+=item C<check_regexp>
+
+Checks that the value is a valid regexp
+
+=back
diff --git a/Bugzilla/Config/Core.pm b/Bugzilla/Config/Core.pm
new file mode 100644
index 000000000..1548dcd9c
--- /dev/null
+++ b/Bugzilla/Config/Core.pm
@@ -0,0 +1,68 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::Core;
+
+use strict;
+
+use Bugzilla::Config::Common;
+
+our $sortkey = 100;
+
+use constant get_param_list => (
+ {
+ name => 'urlbase',
+ type => 't',
+ default => '',
+ checker => \&check_urlbase
+ },
+
+ {
+ name => 'ssl_redirect',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'sslbase',
+ type => 't',
+ default => '',
+ checker => \&check_sslbase
+ },
+
+ {
+ name => 'cookiepath',
+ type => 't',
+ default => '/'
+ },
+);
+
+1;
diff --git a/Bugzilla/Config/DependencyGraph.pm b/Bugzilla/Config/DependencyGraph.pm
new file mode 100644
index 000000000..b217bfb06
--- /dev/null
+++ b/Bugzilla/Config/DependencyGraph.pm
@@ -0,0 +1,52 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::DependencyGraph;
+
+use strict;
+
+use Bugzilla::Config::Common;
+
+our $sortkey = 800;
+
+sub get_param_list {
+ my $class = shift;
+ my @param_list = (
+ {
+ name => 'webdotbase',
+ type => 't',
+ default => 'http://www.research.att.com/~north/cgi-bin/webdot.cgi/%urlbase%',
+ checker => \&check_webdotbase
+ } );
+ return @param_list;
+}
+
+1;
diff --git a/Bugzilla/Config/General.pm b/Bugzilla/Config/General.pm
new file mode 100644
index 000000000..0f043548b
--- /dev/null
+++ b/Bugzilla/Config/General.pm
@@ -0,0 +1,83 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+# Max Kanat-Alexander <mkanat@bugzilla.org>
+
+package Bugzilla::Config::General;
+use strict;
+use Bugzilla::Config::Common;
+
+our $sortkey = 150;
+
+use constant get_param_list => (
+ {
+ name => 'maintainer',
+ type => 't',
+ no_reset => '1',
+ default => '',
+ checker => \&check_email
+ },
+
+ {
+ name => 'docs_urlbase',
+ type => 't',
+ default => 'docs/%lang%/html/',
+ checker => \&check_url
+ },
+
+ {
+ name => 'utf8',
+ type => 'b',
+ default => '0',
+ checker => \&check_utf8
+ },
+
+ {
+ name => 'shutdownhtml',
+ type => 'l',
+ default => ''
+ },
+
+ {
+ name => 'announcehtml',
+ type => 'l',
+ default => ''
+ },
+
+ {
+ name => 'upgrade_notification',
+ type => 's',
+ choices => ['development_snapshot', 'latest_stable_release',
+ 'stable_branch_release', 'disabled'],
+ default => 'latest_stable_release',
+ checker => \&check_notification
+ },
+);
+
+1;
diff --git a/Bugzilla/Config/GroupSecurity.pm b/Bugzilla/Config/GroupSecurity.pm
new file mode 100644
index 000000000..f7f717379
--- /dev/null
+++ b/Bugzilla/Config/GroupSecurity.pm
@@ -0,0 +1,102 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::GroupSecurity;
+
+use strict;
+
+use Bugzilla::Config::Common;
+use Bugzilla::Group;
+
+our $sortkey = 900;
+
+sub get_param_list {
+ my $class = shift;
+
+ my @param_list = (
+ {
+ name => 'makeproductgroups',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'chartgroup',
+ type => 's',
+ choices => \&_get_all_group_names,
+ default => 'editbugs',
+ checker => \&check_group
+ },
+
+ {
+ name => 'insidergroup',
+ type => 's',
+ choices => \&_get_all_group_names,
+ default => '',
+ checker => \&check_group
+ },
+
+ {
+ name => 'timetrackinggroup',
+ type => 's',
+ choices => \&_get_all_group_names,
+ default => 'editbugs',
+ checker => \&check_group
+ },
+
+ {
+ name => 'querysharegroup',
+ type => 's',
+ choices => \&_get_all_group_names,
+ default => 'editbugs',
+ checker => \&check_group
+ },
+
+ {
+ name => 'usevisibilitygroups',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'strict_isolation',
+ type => 'b',
+ default => 0
+ } );
+ return @param_list;
+}
+
+sub _get_all_group_names {
+ my @group_names = map {$_->name} Bugzilla::Group->get_all;
+ unshift(@group_names, '');
+ return \@group_names;
+}
+1;
diff --git a/Bugzilla/Config/LDAP.pm b/Bugzilla/Config/LDAP.pm
new file mode 100644
index 000000000..e47f92308
--- /dev/null
+++ b/Bugzilla/Config/LDAP.pm
@@ -0,0 +1,87 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::LDAP;
+
+use strict;
+
+use Bugzilla::Config::Common;
+
+our $sortkey = 1000;
+
+sub get_param_list {
+ my $class = shift;
+ my @param_list = (
+ {
+ name => 'LDAPserver',
+ type => 't',
+ default => ''
+ },
+
+ {
+ name => 'LDAPstarttls',
+ type => 'b',
+ default => 0
+ },
+
+ {
+ name => 'LDAPbinddn',
+ type => 't',
+ default => ''
+ },
+
+ {
+ name => 'LDAPBaseDN',
+ type => 't',
+ default => ''
+ },
+
+ {
+ name => 'LDAPuidattribute',
+ type => 't',
+ default => 'uid'
+ },
+
+ {
+ name => 'LDAPmailattribute',
+ type => 't',
+ default => 'mail'
+ },
+
+ {
+ name => 'LDAPfilter',
+ type => 't',
+ default => '',
+ } );
+ return @param_list;
+}
+
+1;
diff --git a/Bugzilla/Config/MTA.pm b/Bugzilla/Config/MTA.pm
new file mode 100644
index 000000000..c90e5dc76
--- /dev/null
+++ b/Bugzilla/Config/MTA.pm
@@ -0,0 +1,102 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::MTA;
+
+use strict;
+
+use Bugzilla::Config::Common;
+use Email::Send;
+
+our $sortkey = 1200;
+
+sub get_param_list {
+ my $class = shift;
+ my @param_list = (
+ {
+ name => 'mail_delivery_method',
+ type => 's',
+ # Bugzilla is not ready yet to send mails to newsgroups, and 'IO'
+ # is of no use for now as we already have our own 'Test' mode.
+ choices => [grep {$_ ne 'NNTP' && $_ ne 'IO'} Email::Send->new()->all_mailers(), 'None'],
+ default => 'Sendmail',
+ checker => \&check_mail_delivery_method
+ },
+
+ {
+ name => 'mailfrom',
+ type => 't',
+ default => 'bugzilla-daemon'
+ },
+
+ {
+ name => 'use_mailer_queue',
+ type => 'b',
+ default => 0,
+ checker => \&check_theschwartz_available,
+ },
+
+ {
+ name => 'smtpserver',
+ type => 't',
+ default => 'localhost'
+ },
+ {
+ name => 'smtp_username',
+ type => 't',
+ default => '',
+ checker => \&check_smtp_auth
+ },
+ {
+ name => 'smtp_password',
+ type => 'p',
+ default => ''
+ },
+ {
+ name => 'smtp_debug',
+ type => 'b',
+ default => 0
+ },
+ {
+ name => 'whinedays',
+ type => 't',
+ default => 7,
+ checker => \&check_numeric
+ },
+ {
+ name => 'globalwatchers',
+ type => 't',
+ default => '',
+ }, );
+ return @param_list;
+}
+
+1;
diff --git a/Bugzilla/Config/PatchViewer.pm b/Bugzilla/Config/PatchViewer.pm
new file mode 100644
index 000000000..6bd9557a9
--- /dev/null
+++ b/Bugzilla/Config/PatchViewer.pm
@@ -0,0 +1,75 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::PatchViewer;
+
+use strict;
+
+use Bugzilla::Config::Common;
+
+our $sortkey = 1300;
+
+sub get_param_list {
+ my $class = shift;
+ my @param_list = (
+ {
+ name => 'cvsroot',
+ type => 't',
+ default => '',
+ },
+
+ {
+ name => 'cvsroot_get',
+ type => 't',
+ default => '',
+ },
+
+ {
+ name => 'bonsai_url',
+ type => 't',
+ default => ''
+ },
+
+ {
+ name => 'lxr_url',
+ type => 't',
+ default => ''
+ },
+
+ {
+ name => 'lxr_root',
+ type => 't',
+ default => '',
+ } );
+ return @param_list;
+}
+
+1;
diff --git a/Bugzilla/Config/Query.pm b/Bugzilla/Config/Query.pm
new file mode 100644
index 000000000..821f09fc6
--- /dev/null
+++ b/Bugzilla/Config/Query.pm
@@ -0,0 +1,80 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::Query;
+
+use strict;
+
+use Bugzilla::Config::Common;
+
+our $sortkey = 1400;
+
+sub get_param_list {
+ my $class = shift;
+ my @param_list = (
+ {
+ name => 'quip_list_entry_control',
+ type => 's',
+ choices => ['open', 'moderated', 'closed'],
+ default => 'open',
+ checker => \&check_multi
+ },
+
+ {
+ name => 'mostfreqthreshold',
+ type => 't',
+ default => '2',
+ checker => \&check_numeric
+ },
+
+ {
+ name => 'mybugstemplate',
+ type => 't',
+ default => 'buglist.cgi?resolution=---&amp;emailassigned_to1=1&amp;emailreporter1=1&amp;emailtype1=exact&amp;email1=%userid%'
+ },
+
+ {
+ name => 'defaultquery',
+ type => 't',
+ default => 'resolution=---&emailassigned_to1=1&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailqa_contact2=1&emaillongdesc3=1&order=Importance&long_desc_type=substring'
+ },
+
+ {
+ name => 'specific_search_allow_empty_words',
+ type => 'b',
+ default => 1
+ }
+
+ );
+ return @param_list;
+}
+
+1;
diff --git a/Bugzilla/Config/RADIUS.pm b/Bugzilla/Config/RADIUS.pm
new file mode 100644
index 000000000..bc072a9c4
--- /dev/null
+++ b/Bugzilla/Config/RADIUS.pm
@@ -0,0 +1,60 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Marc Schumann.
+# Portions created by Marc Schumann are Copyright (c) 2007 Marc Schumann.
+# All rights reserved.
+#
+# Contributor(s): Marc Schumann <wurblzap@gmail.com>
+#
+
+package Bugzilla::Config::RADIUS;
+
+use strict;
+
+use Bugzilla::Config::Common;
+
+our $sortkey = 1100;
+
+sub get_param_list {
+ my $class = shift;
+ my @param_list = (
+ {
+ name => 'RADIUS_server',
+ type => 't',
+ default => ''
+ },
+
+ {
+ name => 'RADIUS_secret',
+ type => 't',
+ default => ''
+ },
+
+ {
+ name => 'RADIUS_NAS_IP',
+ type => 't',
+ default => ''
+ },
+
+ {
+ name => 'RADIUS_email_suffix',
+ type => 't',
+ default => ''
+ },
+ );
+ return @param_list;
+}
+
+1;
diff --git a/Bugzilla/Config/ShadowDB.pm b/Bugzilla/Config/ShadowDB.pm
new file mode 100644
index 000000000..a605b2363
--- /dev/null
+++ b/Bugzilla/Config/ShadowDB.pm
@@ -0,0 +1,73 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::ShadowDB;
+
+use strict;
+
+use Bugzilla::Config::Common;
+
+our $sortkey = 1500;
+
+sub get_param_list {
+ my $class = shift;
+ my @param_list = (
+ {
+ name => 'shadowdbhost',
+ type => 't',
+ default => '',
+ },
+
+ {
+ name => 'shadowdbport',
+ type => 't',
+ default => '3306',
+ checker => \&check_numeric,
+ },
+
+ {
+ name => 'shadowdbsock',
+ type => 't',
+ default => '',
+ },
+
+ # This entry must be _after_ the shadowdb{host,port,sock} settings so that
+ # they can be used in the validation here
+ {
+ name => 'shadowdb',
+ type => 't',
+ default => '',
+ checker => \&check_shadowdb
+ } );
+ return @param_list;
+}
+
+1;
diff --git a/Bugzilla/Config/UserMatch.pm b/Bugzilla/Config/UserMatch.pm
new file mode 100644
index 000000000..f97cfeab2
--- /dev/null
+++ b/Bugzilla/Config/UserMatch.pm
@@ -0,0 +1,64 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# 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.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# The Initial Developer of the Original Code is Netscape Communications
+# Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All
+# Rights Reserved.
+#
+# Contributor(s): Terry Weissman <terry@mozilla.org>
+# Dawn Endico <endico@mozilla.org>
+# Dan Mosedale <dmose@mozilla.org>
+# Joe Robins <jmrobins@tgix.com>
+# Jacob Steenhagen <jake@bugzilla.org>
+# J. Paul Reed <preed@sigkill.com>
+# Bradley Baetz <bbaetz@student.usyd.edu.au>
+# Joseph Heenan <joseph@heenan.me.uk>
+# Erik Stambaugh <erik@dasbistro.com>
+# Frédéric Buclin <LpSolit@gmail.com>
+#
+
+package Bugzilla::Config::UserMatch;
+
+use strict;
+
+use Bugzilla::Config::Common;
+
+our $sortkey = 1600;
+
+sub get_param_list {
+ my $class = shift;
+ my @param_list = (
+ {
+ name => 'usemenuforusers',
+ type => 'b',
+ default => '0'
+ },
+
+ {
+ name => 'maxusermatches',
+ type => 't',
+ default => '1000',
+ checker => \&check_numeric
+ },
+
+ {
+ name => 'confirmuniqueusermatch',
+ type => 'b',
+ default => 1,
+ } );
+ return @param_list;
+}
+
+1;