sub _validate_data {
my ($throw_error, $hr_vars) = @_;
my $cgi = Bugzilla->cgi;
- my $maxsize = $cgi->param('ispatch') ? Param('maxpatchsize') : Param('maxattachmentsize');
+ my $maxsize = $cgi->param('ispatch') ? Bugzilla->params->{'maxpatchsize'}
+ : Bugzilla->params->{'maxattachmentsize'};
$maxsize *= 1024; # Convert from K
my $fh;
# Skip uploading into a local variable if the user wants to upload huge
# makes for a quick way to eat up disk space. Let's compress them.
# We do this before we check the size since the uncompressed version
# could easily be greater than maxattachmentsize.
- if (Param('convert_uncompressed_images')
+ if (Bugzilla->params->{'convert_uncompressed_images'}
&& $cgi->param('contenttype') eq 'image/bmp') {
require Image::Magick;
my $img = Image::Magick->new(magick=>'bmp');
open(AH, ">$attachdir/$hash/attachment.$attachid");
binmode AH;
my $sizecount = 0;
- my $limit = (Param("maxlocalattachment") * 1048576);
+ my $limit = (Bugzilla->params->{"maxlocalattachment"} * 1048576);
while (<$fh>) {
print AH $_;
$sizecount += length($_);
my $self = fields::new($class);
$params ||= {};
- $params->{Login} ||= Param('user_info_class') . ',Cookie';
- $params->{Verify} ||= Param('user_verify_class');
+ $params->{Login} ||= Bugzilla->params->{'user_info_class'} . ',Cookie';
+ $params->{Verify} ||= Bugzilla->params->{'user_verify_class'};
$self->{_info_getter} = new Bugzilla::Auth::Login::Stack($params->{Login});
$self->{_verifier} = new Bugzilla::Auth::Verify::Stack($params->{Verify});
my $template = Bugzilla->template;
# Redirect to SSL if required
- if (Param('sslbase') ne '' and Param('ssl') ne 'never') {
- $cgi->require_https(Param('sslbase'));
+ if (Bugzilla->params->{'sslbase'} ne ''
+ and Bugzilla->params->{'ssl'} ne 'never')
+ {
+ $cgi->require_https(Bugzilla->params->{'sslbase'});
}
print $cgi->header();
$template->process("account/auth/login.html.tmpl",
my ($self) = @_;
my $dbh = Bugzilla->dbh;
- my $env_id = $ENV{Param("auth_env_id")} || '';
- my $env_email = $ENV{Param("auth_env_email")} || '';
- my $env_realname = $ENV{Param("auth_env_realname")} || '';
+ my $env_id = $ENV{Bugzilla->params->{"auth_env_id"}} || '';
+ my $env_email = $ENV{Bugzilla->params->{"auth_env_email"}} || '';
+ my $env_realname = $ENV{Bugzilla->params->{"auth_env_realname"}} || '';
return { failure => AUTH_NODATA } if !$env_email;
my $ip_addr = $cgi->remote_addr;
unless ($cgi->param('Bugzilla_restrictlogin') ||
- Param('loginnetmask') == 32)
+ Bugzilla->params->{'loginnetmask'} == 32)
{
$ip_addr = get_netaddr($ip_addr);
}
# Remember cookie only if admin has told so
# or admin didn't forbid it and user told to remember.
- if ( Param('rememberlogin') eq 'on' ||
- (Param('rememberlogin') ne 'off' &&
+ if ( Bugzilla->params->{'rememberlogin'} eq 'on' ||
+ (Bugzilla->params->{'rememberlogin'} ne 'off' &&
$cgi->param('Bugzilla_remember') &&
$cgi->param('Bugzilla_remember') eq 'on') )
{
my $user_entry = $detail_result->shift_entry;
- my $mail_attr = Param("LDAPmailattribute");
+ my $mail_attr = Bugzilla->params->{"LDAPmailattribute"};
if ($mail_attr) {
if (!$user_entry->exists($mail_attr)) {
return { failure => AUTH_ERROR,
sub _bz_search_params {
my ($username) = @_;
- return (base => Param("LDAPBaseDN"),
+ return (base => Bugzilla->params->{"LDAPBaseDN"},
scope => "sub",
- filter => '(&(' . Param("LDAPuidattribute") . "=$username)"
- . Param("LDAPfilter") . ')');
+ filter => '(&(' . Bugzilla->params->{"LDAPuidattribute"}
+ . "=$username)"
+ . Bugzilla->params->{"LDAPfilter"} . ')');
}
sub _bind_ldap_anonymously {
my ($self) = @_;
my $bind_result;
- if (Param("LDAPbinddn")) {
- my ($LDAPbinddn,$LDAPbindpass) = split(":",Param("LDAPbinddn"));
+ if (Bugzilla->params->{"LDAPbinddn"}) {
+ my ($LDAPbinddn,$LDAPbindpass) =
+ split(":",Bugzilla->params->{"LDAPbinddn"});
$bind_result =
$self->ldap->bind($LDAPbinddn, password => $LDAPbindpass);
}
my ($self) = @_;
return $self->{ldap} if $self->{ldap};
- my $server = Param("LDAPserver");
+ my $server = Bugzilla->params->{"LDAPserver"};
ThrowCodeError("ldap_server_not_defined") unless $server;
my $port = DEFAULT_PORT;
|| ThrowCodeError("ldap_connect_failed", { server => $conn_string });
# try to start TLS if needed
- if (Param("LDAPstarttls")) {
+ if (Bugzilla->params->{"LDAPstarttls"}) {
my $mesg = $self->{ldap}->start_tls();
ThrowCodeError("ldap_start_tls_failed", { error => $mesg->error() })
if $mesg->code();
reporter assigned_to cc),
# Conditional Fields
- Param('useqacontact') ? "qa_contact" : (),
- Param('timetrackinggroup') ? qw(estimated_time remaining_time
- actual_time deadline)
- : (),
+ Bugzilla->params->{'useqacontact'} ? "qa_contact" : (),
+ Bugzilla->params->{'timetrackinggroup'} ?
+ qw(estimated_time remaining_time actual_time deadline) : (),
# Custom Fields
Bugzilla->custom_field_names
return $self->{'actual_time'} if exists $self->{'actual_time'};
if ( $self->{'error'} ||
- !Bugzilla->user->in_group(Param("timetrackinggroup")) ) {
+ !Bugzilla->user->in_group(Bugzilla->params->{"timetrackinggroup"}) ) {
$self->{'actual_time'} = undef;
return $self->{'actual_time'};
}
return $self->{'qa_contact'} if exists $self->{'qa_contact'};
return undef if $self->{'error'};
- if (Param('useqacontact') && $self->{'qa_contact_id'}) {
+ if (Bugzilla->params->{'useqacontact'} && $self->{'qa_contact_id'}) {
$self->{'qa_contact'} = new Bugzilla::User($self->{'qa_contact_id'});
} else {
# XXX - This is somewhat inconsistent with the assignee/reporter
$self->{'prod_obj'} ||= new Bugzilla::Product({name => $self->{'product'}});
- return Param('usevotes') && $self->{'prod_obj'}->votes_per_user > 0;
+ return Bugzilla->params->{'usevotes'}
+ && $self->{'prod_obj'}->votes_per_user > 0;
}
sub groups {
return {} if $self->{'error'};
my $user = Bugzilla->user;
- my $canmove = Param('move-enabled') && $user->is_mover;
+ my $canmove = Bugzilla->params->{'move-enabled'} && $user->is_mover;
# In the below, if the person hasn't logged in, then we treat them
# as if they can do anything. That's because we don't know why they
|| $user->in_group("editbugs");
my $canedit = $unknown_privileges
|| $user->id == $self->{assigned_to_id}
- || (Param('useqacontact')
+ || (Bugzilla->params->{'useqacontact'}
&& $self->{'qa_contact_id'}
&& $user->id == $self->{qa_contact_id});
my $canconfirm = $unknown_privileges
# the ID of the bug if it exists or the undefined value if it doesn't.
sub bug_alias_to_id {
my ($alias) = @_;
- return undef unless Param("usebugaliases");
+ return undef unless Bugzilla->params->{"usebugaliases"};
my $dbh = Bugzilla->dbh;
trick_taint($alias);
return $dbh->selectrow_array(
while (my $comment_ref = $sth->fetchrow_hashref()) {
my %comment = %$comment_ref;
- $comment{'email'} .= Param('emailsuffix');
+ $comment{'email'} .= Bugzilla->params->{'emailsuffix'};
$comment{'name'} = $comment{'name'} || $comment{'email'};
push (@comments, \%comment);
# Only includes attachments the user is allowed to see.
my $suppjoins = "";
my $suppwhere = "";
- if (Param("insidergroup") && !UserInGroup(Param('insidergroup'))) {
+ if (Bugzilla->params->{"insidergroup"}
+ && !UserInGroup(Bugzilla->params->{'insidergroup'}))
+ {
$suppjoins = "LEFT JOIN attachments
ON attachments.attach_id = bugs_activity.attach_id";
$suppwhere = "AND COALESCE(attachments.isprivate, 0) = 0";
|| $fieldname eq 'work_time'
|| $fieldname eq 'deadline')
{
- $activity_visible = UserInGroup(Param('timetrackinggroup')) ? 1 : 0;
+ $activity_visible =
+ UserInGroup(Bugzilla->params->{'timetrackinggroup'}) ? 1 : 0;
} else {
$activity_visible = 1;
}
# been reduced or removed.
my $vars = {
- 'to' => $name . Param('emailsuffix'),
+ 'to' => $name . Bugzilla->params->{'emailsuffix'},
'bugid' => $id,
'reason' => $reason,
}
# - change the priority (unless he could have set it originally)
if ($field eq 'priority'
- && !Param('letsubmitterchoosepriority'))
+ && !Bugzilla->params->{'letsubmitterchoosepriority'})
{
$PrivilegesRequired = 2;
return 0;
my $diffpart = {};
if ($who ne $lastwho) {
$lastwho = $who;
- $diffheader = "\n$whoname <$who" . Param('emailsuffix') . "> changed:\n\n";
+ $diffheader = "\n$whoname <$who" . Bugzilla->params->{'emailsuffix'}
+ . "> changed:\n\n";
$diffheader .= FormatTriple("What ", "Removed", "Added");
$diffheader .= ('-' x 76) . "\n";
}
$deptext .= $thisdiff;
}
$lastbug = $depbug;
- my $urlbase = Param("urlbase");
+ my $urlbase = Bugzilla->params->{"urlbase"};
$thisdiff =
"\nBug $id depends on bug $depbug, which changed state.\n\n" .
"Bug $depbug Summary: $summary\n" .
$recipients{$reporter}->{+REL_REPORTER} = BIT_DIRECT;
# QA Contact
- if (Param('useqacontact')) {
+ if (Bugzilla->params->{'useqacontact'}) {
foreach (@qa_contacts) {
# QA Contact can be blank; ignore it if so.
$recipients{$_}->{+REL_QA} = BIT_DIRECT if $_;
}
}
- if (Param("supportwatchers")) {
+ if (Bugzilla->params->{"supportwatchers"}) {
# Find all those user-watching anyone on the current list, who is not
# on it already themselves.
my $involved = join(",", keys %recipients);
# If we are using insiders, and the comment is private, only send
# to insiders
my $insider_ok = 1;
- $insider_ok = 0 if (Param("insidergroup") &&
+ $insider_ok = 0 if (Bugzilla->params->{"insidergroup"} &&
($anyprivate != 0) &&
- (!$user->groups->{Param("insidergroup")}));
+ (!$user->groups->{Bugzilla->params->{"insidergroup"}}));
# We shouldn't send mail if this is a dependency mail (i.e. there
# is something in @depbugs), and any of the depending bugs are not
}
# Only send estimated_time if it is enabled and the user is in the group
if (($f ne 'estimated_time' && $f ne 'deadline') ||
- $user->groups->{Param('timetrackinggroup')}) {
+ $user->groups->{Bugzilla->params->{'timetrackinggroup'}}) {
my $desc = $fielddescription{$f};
$head .= FormatDouble($desc, $value);
$diff->{'fieldname'} eq 'remaining_time' ||
$diff->{'fieldname'} eq 'work_time' ||
$diff->{'fieldname'} eq 'deadline')){
- if ($user->groups->{Param("timetrackinggroup")}) {
+ if ($user->groups->{Bugzilla->params->{"timetrackinggroup"}}) {
$add_diff = 1;
}
} elsif (($diff->{'isprivate'})
- && Param('insidergroup')
- && !($user->groups->{Param('insidergroup')})
+ && Bugzilla->params->{'insidergroup'}
+ && !($user->groups->{Bugzilla->params->{'insidergroup'}})
) {
$add_diff = 0;
} else {
if ( $newcomments =~ /Created an attachment \(/ ) {
my $showattachurlbase =
- Param('urlbase') . "attachment.cgi?id=";
+ Bugzilla->params->{'urlbase'} . "attachment.cgi?id=";
$newcomments =~ s/(Created an attachment \(id=([0-9]+)\))/$1\n --> \(${showattachurlbase}$2\)/g;
}
$substs{"changer"} = $values{'changer'};
$substs{"changername"} = $values{'changername'};
- my $sitespec = '@' . Param('urlbase');
+ my $sitespec = '@' . Bugzilla->params->{'urlbase'};
$sitespec =~ s/:\/\//\./; # Make the protocol look like part of the domain
$sitespec =~ s/^([^:\/]+):(\d+)/$1/; # Remove a port number, to relocate
if ($2) {
$user->id . "$sitespec>";
}
- my $template = Param("newchangedmail");
+ my $template = Bugzilla->params->{"newchangedmail"};
my $msg = perform_substs($template, \%substs);
my ($login, $password) = (@_);
my $template = Bugzilla->template;
my $vars = {
- mailaddress => $login . Param('emailsuffix'),
+ mailaddress => $login . Bugzilla->params->{'emailsuffix'},
login => $login,
password => $password };
my $msg;
my ($who, $whoname, $when, $text, $isprivate, $already_wrapped) = @$_;
if ($count) {
$result .= "\n\n--- Comment #$count from $whoname <$who" .
- Param('emailsuffix'). "> " . format_time($when) .
- " ---\n";
+ Bugzilla->params->{'emailsuffix'}. "> "
+ . format_time($when) . " ---\n";
}
- if ($isprivate > 0 && Param('insidergroup')) {
+ if ($isprivate > 0 && Bugzilla->params->{'insidergroup'}) {
$anyprivate = 1;
}
$result .= ($already_wrapped ? $text : wrap_comment($text));
# Getting parameters
use Bugzilla::Config;
- my $fooSetting = Param('foo');
+ my $fooSetting = Bugzilla->params->{'foo'};
# Administration functions
use Bugzilla::Config qw(:admin);
=over 4
-=item C<Param($name)>
+=item C<Bugzilla->params->{$name}>
Returns the Param with the specified name. Either a string, or, in the case
of multiple-choice parameters, an array reference.
#####################################################################
sub connect_shadow {
- die "Tried to connect to non-existent shadowdb" unless Param('shadowdb');
+ my $params = Bugzilla->params;
+ die "Tried to connect to non-existent shadowdb"
+ unless $params->{'shadowdb'};
- return _connect($db_driver, Param("shadowdbhost"),
- Param('shadowdb'), Param("shadowdbport"),
- Param("shadowdbsock"), $db_user, $db_pass);
+ return _connect($db_driver, $params->{"shadowdbhost"},
+ $params->{'shadowdb'}, $params->{"shadowdbport"},
+ $params->{"shadowdbsock"}, $db_user, $db_pass);
}
sub connect_main {
my ($self) = @_;
my $extra = "";
- if (!Bugzilla->user->in_group(Param('timetrackinggroup'))) {
+ if (!Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'})) {
$extra = "AND name NOT IN ('estimated_time', 'remaining_time', " .
"'work_time', 'percentage_complete', 'deadline')";
}
# the requestee isn't in the group of insiders who can see it.
if ($attach_id
&& $cgi->param('isprivate')
- && Param("insidergroup")
- && !$requestee->in_group(Param("insidergroup")))
+ && Bugzilla->params->{"insidergroup"}
+ && !$requestee->in_group(Bugzilla->params->{"insidergroup"}))
{
ThrowUserError("flag_requestee_unauthorized_attachment",
{ flag_type => $flag->{'type'},
next if ($bug->groups && !$ccuser->can_see_bug($bug->bug_id));
next if $attachment_is_private
- && Param("insidergroup")
- && !$ccuser->in_group(Param("insidergroup"));
+ && Bugzilla->params->{"insidergroup"}
+ && !$ccuser->in_group(Bugzilla->params->{"insidergroup"});
push(@new_cc_list, $cc);
}
$flag->{'type'}->{'cc_list'} = join(", ", @new_cc_list);
# Throw an error if the target is a private attachment and
# the requestee isn't in the group of insiders who can see it.
if ($attach_id
- && Param("insidergroup")
+ && Bugzilla->params->{"insidergroup"}
&& $cgi->param('isprivate')
- && !$requestee->in_group(Param("insidergroup")))
+ && !$requestee->in_group(Bugzilla->params->{"insidergroup"}))
{
ThrowUserError("flag_requestee_unauthorized_attachment",
{ flag_type => $flag_type,
sub MessageToMTA {
my ($msg) = (@_);
- return if (Param('mail_delivery_method') eq "none");
+ my $params = Bugzilla->params;
+ return if ($params->{'mail_delivery_method'} eq "none");
my ($header, $body) = $msg =~ /(.*?\n)\n(.*)/s ? ($1, $2) : ('', $msg);
my $headers;
- if (Param('utf8') and (!is_7bit_clean($header) or !is_7bit_clean($body))) {
+ if ($params->{'utf8'}
+ and (!is_7bit_clean($header) or !is_7bit_clean($body)))
+ {
($headers, $body) = encode_message($msg);
} else {
my @header_lines = split(/\n/, $header);
# Use trim to remove any whitespace (incl. newlines)
my $from = trim($headers->get('from'));
- if (Param("mail_delivery_method") eq "sendmail" && $^O =~ /MSWin32/i) {
+ if ($params->{"mail_delivery_method"} eq "sendmail" && $^O =~ /MSWin32/i) {
my $cmd = '|' . SENDMAIL_EXE . ' -t -i';
if ($from) {
# We're on Windows, thus no danger of command injection
}
my @args;
- if (Param("mail_delivery_method") eq "sendmail") {
+ if ($params->{"mail_delivery_method"} eq "sendmail") {
push @args, "-i";
if ($from) {
push(@args, "-f$from");
}
}
- if (Param("mail_delivery_method") eq "sendmail" && !Param("sendmailnow")) {
+ if ($params->{"mail_delivery_method"} eq "sendmail"
+ && !$params->{"sendmailnow"})
+ {
push @args, "-ODeliveryMode=deferred";
}
- if (Param("mail_delivery_method") eq "smtp") {
- push @args, Server => Param("smtpserver");
+ if ($params->{"mail_delivery_method"} eq "smtp") {
+ push @args, Server => $params->{"smtpserver"};
if ($from) {
$ENV{'MAILADDRESS'} = $from;
}
}
- my $mailer = new Mail::Mailer Param("mail_delivery_method"), @args;
- if (Param("mail_delivery_method") eq "testfile") {
+ my $mailer = new Mail::Mailer($params->{"mail_delivery_method"}, @args);
+ if ($params->{"mail_delivery_method"} eq "testfile") {
$Mail::Mailer::testfile::config{outfile} =
bz_locations()->{'datadir'} . '/mailer.testfile';
}
my $sql_deadlinefrom;
my $sql_deadlineto;
- if (Bugzilla->user->in_group(Param('timetrackinggroup'))){
+ if (Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'})){
my $deadlinefrom;
my $deadlineto;
# Add the longdescs table to the query so we can search comments.
my $table = "longdescs_$chartid";
my $extra = "";
- if (Param("insidergroup")
- && !UserInGroup(Param("insidergroup")))
+ if (Bugzilla->params->{"insidergroup"}
+ && !UserInGroup(Bugzilla->params->{"insidergroup"}))
{
$extra = "AND $table.isprivate < 1";
}
}
my $table = "longdescs_$chartseq";
my $extra = "";
- if (Param("insidergroup") && !UserInGroup(Param("insidergroup"))) {
+ if (Bugzilla->params->{"insidergroup"}
+ && !UserInGroup(Bugzilla->params->{"insidergroup"}))
+ {
$extra = "AND $table.isprivate < 1";
}
push(@supptables, "LEFT JOIN longdescs AS $table " .
}
my $table = "longdescs_$chartseq";
my $extra = "";
- if (Param("insidergroup") && !UserInGroup(Param("insidergroup"))) {
+ if (Bugzilla->params->{"insidergroup"}
+ && !UserInGroup(Bugzilla->params->{"insidergroup"}))
+ {
$extra = "AND $table.isprivate < 1";
}
if ($list) {
"^long_?desc," => sub {
my $table = "longdescs_$chartid";
my $extra = "";
- if (Param("insidergroup") && !UserInGroup(Param("insidergroup"))) {
+ if (Bugzilla->params->{"insidergroup"}
+ && !UserInGroup(Bugzilla->params->{"insidergroup"}))
+ {
$extra = "AND $table.isprivate < 1";
}
push(@supptables, "INNER JOIN longdescs AS $table " .
my $atable = "attachments_$chartid";
my $dtable = "attachdata_$chartid";
my $extra = "";
- if (Param("insidergroup") && !UserInGroup(Param("insidergroup"))) {
+ if (Bugzilla->params->{"insidergroup"}
+ && !UserInGroup(Bugzilla->params->{"insidergroup"}))
+ {
$extra = "AND $atable.isprivate = 0";
}
push(@supptables, "INNER JOIN attachments AS $atable " .
"^attachments\..*," => sub {
my $table = "attachments_$chartid";
my $extra = "";
- if (Param("insidergroup") && !UserInGroup(Param("insidergroup"))) {
+ if (Bugzilla->params->{"insidergroup"}
+ && !UserInGroup(Bugzilla->params->{"insidergroup"}))
+ {
$extra = "AND $table.isprivate = 0";
}
push(@supptables, "INNER JOIN attachments AS $table " .
$query .= " OR (bugs.reporter_accessible = 1 AND bugs.reporter = $userid) " .
" OR (bugs.cclist_accessible = 1 AND cc.who IS NOT NULL) " .
" OR (bugs.assigned_to = $userid) ";
- if (Param('useqacontact')) {
+ if (Bugzilla->params->{'useqacontact'}) {
$query .= "OR (bugs.qa_contact = $userid) ";
}
}
if (index($searchstring, ',') < $[) {
# Single bug number; shortcut to show_bug.cgi.
- print $cgi->redirect(-uri => Param('urlbase') .
+ print $cgi->redirect(-uri => Bugzilla->params->{'urlbase'} .
"show_bug.cgi?id=$searchstring");
exit;
}
WHERE alias = ?},
undef,
$1)) {
- print $cgi->redirect(-uri => Param('urlbase') .
+ print $cgi->redirect(-uri => Bugzilla->params->{'urlbase'} .
"show_bug.cgi?id=$1");
exit;
}
$searchstring =~ s/\s+NOT\s+/ -/g;
my @words = splitString($searchstring);
- my $searchComments = $#words < Param('quicksearch_comment_cutoff');
+ my $searchComments =
+ $#words < Bugzilla->params->{'quicksearch_comment_cutoff'};
my @openStates = BUG_STATE_OPEN;
my @closedStates;
my (%states, %resolutions);
if ($cgi->param('load')) {
# Param 'load' asks us to display the query in the advanced search form.
- print $cgi->redirect(-uri => Param('urlbase') . "query.cgi?" .
- "format=advanced&" .
- $modified_query_string);
+ print $cgi->redirect(-uri => Bugzilla->params->{'urlbase'}
+ . "query.cgi?format=advanced&"
+ . $modified_query_string);
}
# Otherwise, pass the modified query string to the caller.
my $templatedir = bz_locations()->{'templatedir'};
my $project = bz_locations()->{'project'};
- my $languages = trim(Param('languages'));
+ my $languages = trim(Bugzilla->params->{'languages'});
if (not ($languages =~ /,/)) {
if ($project) {
$template_include_path = [
push (@usedlanguages, @found);
}
}
- push(@usedlanguages, Param('defaultlanguage'));
+ push(@usedlanguages, Bugzilla->params->{'defaultlanguage'});
if ($project) {
$template_include_path = [
map((
my $tmp;
# Provide tooltips for full bug links (Bug 74355)
- my $urlbase_re = '(' . join('|', map { qr/$_/ } grep($_, Param('urlbase'), Param('sslbase'))) . ')';
+ my $urlbase_re = '(' . join('|',
+ map { qr/$_/ } grep($_, Bugzilla->params->{'urlbase'},
+ Bugzilla->params->{'sslbase'})) . ')';
$text =~ s~\b(${urlbase_re}\Qshow_bug.cgi?id=\E([0-9]+))\b
~($things[$count++] = get_bug_link($3, $1)) &&
("\0\0" . ($count-1) . "\0\0")
my ($var) = Template::Filters::html_filter(@_);
# Obscure '@'.
$var =~ s/\@/\@/g;
- if (Param('utf8')) {
+ if (Bugzilla->params->{'utf8'}) {
# Remove the following characters because they're
# influencing BiDi:
# --------------------------------------------------------
# get a list of languages we accept so we can find the hook
# that corresponds to our desired languages:
sub getLanguages() {
- my $languages = trim(Param('languages'));
+ my $languages = trim(Bugzilla->params->{'languages'});
if (not ($languages =~ /,/)) { # only one language
return $languages;
}
sub IssueEmailChangeToken {
my ($userid, $old_email, $new_email) = @_;
+ my $email_suffix = Bugzilla->params->{'emailsuffix'};
my ($token, $token_ts) = _create_token($userid, 'emailold', $old_email . ":" . $new_email);
my $template = Bugzilla->template;
my $vars = {};
- $vars->{'oldemailaddress'} = $old_email . Param('emailsuffix');
- $vars->{'newemailaddress'} = $new_email . Param('emailsuffix');
+ $vars->{'oldemailaddress'} = $old_email . $email_suffix;
+ $vars->{'newemailaddress'} = $new_email . $email_suffix;
$vars->{'max_token_age'} = $maxtokenage;
$vars->{'token_ts'} = $token_ts;
$vars->{'token'} = $token;
- $vars->{'emailaddress'} = $old_email . Param('emailsuffix');
+ $vars->{'emailaddress'} = $old_email . $email_suffix;
my $message;
$template->process("account/email/change-old.txt.tmpl", $vars, \$message)
MessageToMTA($message);
$vars->{'token'} = $newtoken;
- $vars->{'emailaddress'} = $new_email . Param('emailsuffix');
+ $vars->{'emailaddress'} = $new_email . $email_suffix;
$message = "";
$template->process("account/email/change-new.txt.tmpl", $vars, \$message)
# Mail the user the token along with instructions for using it.
$vars->{'token'} = $token;
- $vars->{'emailaddress'} = $loginname . Param('emailsuffix');
+ $vars->{'emailaddress'} = $loginname . Bugzilla->params->{'emailsuffix'};
$vars->{'max_token_age'} = $maxtokenage;
$vars->{'token_ts'} = $token_ts;
undef, $token);
# Get the email address of the Bugzilla maintainer.
- my $maintainer = Param('maintainer');
+ my $maintainer = Bugzilla->params->{'maintainer'};
my $template = Bugzilla->template;
- $vars->{'emailaddress'} = $loginname . Param('emailsuffix');
+ $vars->{'emailaddress'} = $loginname . Bugzilla->params->{'emailsuffix'};
$vars->{'maintainer'} = $maintainer;
$vars->{'remoteaddress'} = $::ENV{'REMOTE_ADDR'};
$vars->{'token'} = $token;
# Accessors for user attributes
sub id { $_[0]->{id}; }
sub login { $_[0]->{login}; }
-sub email { $_[0]->{login} . Param('emailsuffix'); }
+sub email { $_[0]->{login} . Bugzilla->params->{'emailsuffix'}; }
sub name { $_[0]->{name}; }
sub disabledtext { $_[0]->{'disabledtext'}; }
sub is_disabled { $_[0]->disabledtext ? 1 : 0; }
}
# If visibilitygroups are used, restrict the set of groups.
- if ((!$self->in_group('editusers')) && Param('usevisibilitygroups')) {
+ if (!$self->in_group('editusers')
+ && Bugzilla->params->{'usevisibilitygroups'})
+ {
# Users need to see a group in order to bless it.
my $visibleGroups = join(', ', @{$self->visible_groups_direct()})
|| return $self->{'bless_groups'} = [];
my ($self, $otherUser) = @_;
my $query;
- if (Param('usevisibilitygroups')) {
+ if (Bugzilla->params->{'usevisibilitygroups'}) {
# If the user can see no groups, then no users are visible either.
my $visibleGroups = $self->visible_groups_as_string() || return 0;
$query = qq{SELECT COUNT(DISTINCT userid)
$self->{sthCanSeeBug} = $sth;
return ($ready
&& ((($reporter == $userid) && $reporter_access)
- || (Param('useqacontact') && $qacontact && ($qacontact == $userid))
+ || (Bugzilla->params->{'useqacontact'}
+ && $qacontact && ($qacontact == $userid))
|| ($owner == $userid)
|| ($isoncclist && $cclist_access)
|| (!$missinggroup)));
"FROM products " .
"LEFT JOIN group_control_map " .
"ON group_control_map.product_id = products.id ";
- if (Param('useentrygroupdefault')) {
+ if (Bugzilla->params->{'useentrygroupdefault'}) {
$query .= "AND group_control_map.entry != 0 ";
} else {
$query .= "AND group_control_map.membercontrol = " .
$self->groups_as_string . ") " .
"WHERE group_id IS NULL ";
- if (Param('useclassification') && $classification_id) {
+ if (Bugzilla->params->{'useclassification'} && $classification_id) {
$query .= "AND classification_id = ? ";
detaint_natural($classification_id);
push(@params, $classification_id);
# first try wildcards
my $wildstr = $str;
- if ($wildstr =~ s/\*/\%/g && # don't do wildcards if no '*' in the string
- Param('usermatchmode') ne 'off') { # or if we only want exact matches
+ if ($wildstr =~ s/\*/\%/g # don't do wildcards if no '*' in the string
+ # or if we only want exact matches
+ && Bugzilla->params->{'usermatchmode'} ne 'off')
+ {
# Build the query.
trick_taint($wildstr);
my $query = "SELECT DISTINCT login_name FROM profiles ";
- if (Param('usevisibilitygroups')) {
+ if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= "INNER JOIN user_group_map
ON user_group_map.user_id = profiles.userid ";
}
$query .= "WHERE ("
. $dbh->sql_istrcmp('login_name', '?', "LIKE") . " OR " .
$dbh->sql_istrcmp('realname', '?', "LIKE") . ") ";
- if (Param('usevisibilitygroups')) {
+ if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= "AND isbless = 0 " .
"AND group_id IN(" .
join(', ', (-1, @{$user->visible_groups_inherited})) . ") ";
# then try substring search
if ((scalar(@users) == 0)
- && (Param('usermatchmode') eq 'search')
+ && (Bugzilla->params->{'usermatchmode'} eq 'search')
&& (length($str) >= 3))
{
$str = lc($str);
trick_taint($str);
my $query = "SELECT DISTINCT login_name FROM profiles ";
- if (Param('usevisibilitygroups')) {
+ if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= "INNER JOIN user_group_map
ON user_group_map.user_id = profiles.userid ";
}
$query .= " WHERE (" .
$dbh->sql_position('?', 'LOWER(login_name)') . " > 0" . " OR " .
$dbh->sql_position('?', 'LOWER(realname)') . " > 0) ";
- if (Param('usevisibilitygroups')) {
+ if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= " AND isbless = 0" .
" AND group_id IN(" .
join(', ', (-1, @{$user->visible_groups_inherited})) . ") ";
my $need_confirm = 0; # whether to display confirmation screen
my $match_multiple = 0; # whether we ever matched more than one user
+ my $params = Bugzilla->params;
+
# prepare default form values
# What does a "--do_not_change--" field look like (if any)?
}
my $limit = 0;
- if (Param('maxusermatches')) {
- $limit = Param('maxusermatches') + 1;
+ if ($params->{'maxusermatches'}) {
+ $limit = $params->{'maxusermatches'} + 1;
}
for my $query (@queries) {
$cgi->append(-name=>$field,
-values=>[@{$users}[0]->{'login'}]);
- $need_confirm = 1 if Param('confirmuniqueusermatch');
+ $need_confirm = 1 if $params->{'confirmuniqueusermatch'};
}
elsif ((scalar(@{$users}) > 1)
- && (Param('maxusermatches') != 1)) {
+ && ($params->{'maxusermatches'} != 1)) {
$need_confirm = 1;
$match_multiple = 1;
- if ((Param('maxusermatches'))
- && (scalar(@{$users}) > Param('maxusermatches')))
+ if (($params->{'maxusermatches'})
+ && (scalar(@{$users}) > $params->{'maxusermatches'}))
{
$matches->{$field}->{$query}->{'status'} = 'trunc';
pop @{$users}; # take the last one out
my $self = shift;
if (!defined $self->{'is_mover'}) {
- my @movers = map { trim($_) } split(',', Param('movers'));
+ my @movers = map { trim($_) } split(',', Bugzilla->params->{'movers'});
$self->{'is_mover'} = ($self->id
&& lsearch(\@movers, $self->login) != -1);
}
my $dbh = Bugzilla->dbh;
my $query = "SELECT DISTINCT login_name, realname,";
- if (Param('usevisibilitygroups')) {
+ if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= " COUNT(group_id) ";
} else {
$query .= " 1 ";
}
$query .= "FROM profiles ";
- if (Param('usevisibilitygroups')) {
+ if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= "LEFT JOIN user_group_map " .
"ON user_group_map.user_id = userid AND isbless = 0 " .
"AND group_id IN(" .
# Make sure the user is authorized to access this attachment's bug.
ValidateBugID($bugid);
- if ($isprivate && Param("insidergroup")) {
- UserInGroup(Param("insidergroup"))
+ if ($isprivate && Bugzilla->params->{"insidergroup"}) {
+ UserInGroup(Bugzilla->params->{"insidergroup"})
|| ThrowUserError("auth_failure", {action => "access",
object => "attachment"});
}
my $last_reader = $reader;
# fixes patch root (makes canonical if possible)
- if (Param('cvsroot')) {
- my $fix_patch_root = new PatchReader::FixPatchRoot(Param('cvsroot'));
+ if (Bugzilla->params->{'cvsroot'}) {
+ my $fix_patch_root =
+ new PatchReader::FixPatchRoot(Bugzilla->params->{'cvsroot'});
$last_reader->sends_data_to($fix_patch_root);
$last_reader = $fix_patch_root;
}
my $reader = new PatchReader::Raw;
my $last_reader = $reader;
# Fix the patch root if we have a cvs root
- if (Param('cvsroot'))
+ if (Bugzilla->params->{'cvsroot'})
{
require PatchReader::FixPatchRoot;
- $last_reader->sends_data_to(new PatchReader::FixPatchRoot(Param('cvsroot')));
+ $last_reader->sends_data_to(
+ new PatchReader::FixPatchRoot(Bugzilla->params->{'cvsroot'}));
$last_reader->sends_data_to->diff_root($diff_root) if defined($diff_root);
$last_reader = $last_reader->sends_data_to;
}
# Add in cvs context if we have the necessary info to do it
- if ($context ne "patch" && $cvsbin && Param('cvsroot_get'))
+ if ($context ne "patch" && $cvsbin && Bugzilla->params->{'cvsroot_get'})
{
require PatchReader::AddCVSContext;
$last_reader->sends_data_to(
new PatchReader::AddCVSContext($context,
- Param('cvsroot_get')));
+ Bugzilla->params->{'cvsroot_get'}));
$last_reader = $last_reader->sends_data_to;
}
return ($reader, $last_reader);
}
$vars->{collapsed} = $cgi->param('collapsed');
$vars->{context} = $context;
- $vars->{do_context} = $cvsbin && Param('cvsroot_get') && !$vars->{'newid'};
+ $vars->{do_context} = $cvsbin && Bugzilla->params->{'cvsroot_get'}
+ && !$vars->{'newid'};
# Print everything out
print $cgi->header(-type => 'text/html',
"attachment/diff-file.$format.tmpl",
"attachment/diff-footer.$format.tmpl",
{ %{$vars},
- bonsai_url => Param('bonsai_url'),
- lxr_url => Param('lxr_url'),
- lxr_root => Param('lxr_root'),
+ bonsai_url => Bugzilla->params->{'bonsai_url'},
+ lxr_url => Bugzilla->params->{'lxr_url'},
+ lxr_root => Bugzilla->params->{'lxr_root'},
}));
}
my $privacy = "";
my $dbh = Bugzilla->dbh;
- if (Param("insidergroup") && !(UserInGroup(Param("insidergroup")))) {
+ if ( Bugzilla->params->{"insidergroup"}
+ && !UserInGroup(Bugzilla->params->{"insidergroup"}) )
+ {
$privacy = "AND isprivate < 1 ";
}
my $attachments = $dbh->selectall_arrayref(
action => 'delete',
object => 'attachment'});
- Param('allow_attachment_deletion')
+ Bugzilla->params->{'allow_attachment_deletion'}
|| ThrowUserError('attachment_deletion_disabled');
# Make sure the administrator is allowed to edit this attachment.
# Remove the timetracking columns if they are not a part of the group
# (happens if a user had access to time tracking and it was revoked/disabled)
-if (!UserInGroup(Param("timetrackinggroup"))) {
+if (!UserInGroup(Bugzilla->params->{"timetrackinggroup"})) {
@displaycolumns = grep($_ ne 'estimated_time', @displaycolumns);
@displaycolumns = grep($_ ne 'remaining_time', @displaycolumns);
@displaycolumns = grep($_ ne 'actual_time', @displaycolumns);
"resolution");
# if using classification, we also need to look in product.classification_id
-if (Param("useclassification")) {
+if (Bugzilla->params->{"useclassification"}) {
push (@selectcolumns,"product");
}
my @bugowners = keys %$bugowners;
if (scalar(@bugowners) > 1 && UserInGroup('editbugs')) {
- my $suffix = Param('emailsuffix');
+ my $suffix = Bugzilla->params->{'emailsuffix'};
map(s/$/$suffix/, @bugowners) if $suffix;
my $bugowners = join(",", @bugowners);
$vars->{'bugowners'} = $bugowners;
$vars->{'versions'} = [map($_->name ,@{$product->versions})];
$vars->{'components'} = [map($_->name, @{$product->components})];
$vars->{'targetmilestones'} = [map($_->name, @{$product->milestones})]
- if Param('usetargetmilestone');
+ if Bugzilla->params->{'usetargetmilestone'};
}
}
# close the "please wait" page, then open the buglist page
print $cgi->multipart_end();
my @extra;
- push @extra, (-charset => "utf8") if Param("utf8");
+ push @extra, (-charset => "utf8") if Bugzilla->params->{"utf8"};
print $cgi->multipart_start(-type => $contenttype,
-content_disposition => $disposition,
@extra);
my $user = Bugzilla->login(LOGIN_REQUIRED);
-UserInGroup(Param("chartgroup"))
- || ThrowUserError("auth_failure", {group => Param("chartgroup"),
+UserInGroup(Bugzilla->params->{"chartgroup"})
+ || ThrowUserError("auth_failure", {group => Bugzilla->params->{"chartgroup"},
action => "use",
object => "charts"});
# if running on Windows and no third party sendmail wrapper
# is available
if ($^O =~ /MSWin32/i
- && Param('mail_delivery_method') eq 'sendmail'
+ && Bugzilla->params->{'mail_delivery_method'} eq 'sendmail'
&& !-e SENDMAIL_EXE)
{
print "\nBugzilla requires an SMTP server to function on Windows.\n" .
# Check for LDAP
###########################################################################
-for my $verifymethod (split /,\s*/, Param('user_verify_class')) {
+for my $verifymethod (split /,\s*/, Bugzilla->params->{'user_verify_class'}) {
if ($verifymethod eq 'LDAP') {
my $netLDAP = have_vers("Net::LDAP", 0);
if (!$netLDAP && !$silent) {
# and that the generated images are accessible.
#
-if( Param('webdotbase') && Param('webdotbase') !~ /^https?:/ ) {
+if( Bugzilla->params->{'webdotbase'} && Bugzilla->params->{'webdotbase'} !~ /^https?:/ ) {
printf("Checking for %15s %-9s ", "GraphViz", "(any)") unless $silent;
- if(-x Param('webdotbase')) {
+ if(-x Bugzilla->params->{'webdotbase'}) {
print "ok: found\n" unless $silent;
} else {
- print "not a valid executable: " . Param('webdotbase') . "\n";
+ print "not a valid executable: " . Bugzilla->params->{'webdotbase'} . "\n";
}
# Check .htaccess allows access to generated images
#
# If group_control_map is empty, backward-compatibility
# usebuggroups-equivalent records should be created.
-my $entry = Param('useentrygroupdefault');
+my $entry = Bugzilla->params->{'useentrygroupdefault'};
$sth = $dbh->prepare("SELECT COUNT(*) FROM group_control_map");
$sth->execute();
my ($mapcnt) = $sth->fetchrow_array();
undef, "Other", "other");
$dbh->do('UPDATE bugs SET op_sys = ? WHERE op_sys = ?',
undef, "Other", "other");
- if (Param('defaultopsys') eq 'other') {
+ if (Bugzilla->params->{'defaultopsys'} eq 'other') {
# We can't actually fix the param here, because WriteParams() will
# make $datadir/params unwriteable to the webservergroup.
# It's too much of an ugly hack to copy the permission-fixing code
if (-e "$datadir/params") {
require "$datadir/params"; # if they have a params file, use that
}
- if (Param('emailregexp')) {
- $mailcheckexp = Param('emailregexp');
- $mailcheck = Param('emailregexpdesc');
+ if (Bugzilla->params->{'emailregexp'}) {
+ $mailcheckexp = Bugzilla->params->{'emailregexp'};
+ $mailcheck = Bugzilla->params->{'emailregexpdesc'};
} else {
$mailcheckexp = '^[\\w\\.\\+\\-=]+@[\\w\\.\\-]+\\.[\\w\\-]+$';
$mailcheck = 'A legal address must contain exactly one \'@\',
last;
}
-if (Param('urlbase') eq $urlbase_default) {
+if (Bugzilla->params->{'urlbase'} eq $urlbase_default) {
print "Now that you have installed Bugzilla, you should visit the \n" .
"'Parameters' page (linked in the footer of the Administrator \n" .
"account) to ensure it is set up as you wish - this includes \n" .
"reporter", "reporter_realname", "bug_status",
"resolution");
-if (Param("useclassification")) {
+if (Bugzilla->params->{"useclassification"}) {
push(@masterlist, "classification");
}
push(@masterlist, ("product", "component", "version", "op_sys"));
-if (Param("usevotes")) {
+if (Bugzilla->params->{"usevotes"}) {
push (@masterlist, "votes");
}
-if (Param("usebugaliases")) {
+if (Bugzilla->params->{"usebugaliases"}) {
unshift(@masterlist, "alias");
}
-if (Param("usetargetmilestone")) {
+if (Bugzilla->params->{"usetargetmilestone"}) {
push(@masterlist, "target_milestone");
}
-if (Param("useqacontact")) {
+if (Bugzilla->params->{"useqacontact"}) {
push(@masterlist, "qa_contact");
push(@masterlist, "qa_contact_realname");
}
-if (Param("usestatuswhiteboard")) {
+if (Bugzilla->params->{"usestatuswhiteboard"}) {
push(@masterlist, "status_whiteboard");
}
if (Bugzilla::Keyword::keyword_count()) {
push(@masterlist, "keywords");
}
-if (UserInGroup(Param("timetrackinggroup"))) {
+if (UserInGroup(Bugzilla->params->{"timetrackinggroup"})) {
push(@masterlist, ("estimated_time", "remaining_time", "actual_time",
"percentage_complete", "deadline"));
}
}
}
my $list = join(" ", @collist);
- my $urlbase = Param("urlbase");
+ my $urlbase = Bugzilla->params->{"urlbase"};
if ($list) {
$cgi->send_cookie(-name => 'COLUMNLIST',
# If the 'requirelogin' parameter is on and the user is not
# authenticated, return empty fields.
-if (Param('requirelogin') && !$user->id) {
+if (Bugzilla->params->{'requirelogin'} && !$user->id) {
display_data();
}
#
# You need to work with bug_email.pl the MIME::Parser installed.
#
-# $Id: bug_email.pl,v 1.42 2006/06/21 00:44:48 lpsolit%gmail.com Exp $
+# $Id: bug_email.pl,v 1.43 2006/07/03 21:26:22 mkanat%bugzilla.org Exp $
###############################################################
# 02/12/2000 (SML)
my $Text = "You sent wrong priority-setting, valid values are:" .
join( "\n\t", @$all_prios ) . "\n\n";
$Text .= "* The priority is set to the default value ".
- Param('defaultpriority') . "\n";
+ Bugzilla->params->{'defaultpriority'} . "\n";
BugMailError( 0, $Text );
# set default value from param-file
- $Control{'priority'} = Param( 'defaultpriority' );
+ $Control{'priority'} = Bugzilla->params->{ 'defaultpriority' };
} else {
# Nothing to do
}
}
# Set QA
-if (Param("useqacontact")) {
+if (Bugzilla->params->{"useqacontact"}) {
if (defined($Control{'qa_contact'})
&& $Control{'qa_contact'} !~ /^\s*$/ ) {
$Control{'qa_contact'} = DBname_to_id($Control{'qa_contact'});
#
# Nick Barnes, Ravenbrook Limited, 2004-04-01.
#
-# $Id: sendbugmail.pl,v 1.5 2006/06/21 00:44:48 lpsolit%gmail.com Exp $
+# $Id: sendbugmail.pl,v 1.6 2006/07/03 21:26:22 mkanat%bugzilla.org Exp $
#
# Bugzilla email script for Bugzilla 2.17.4 and later. Invoke this to send
# bugmail for a bug which has been changed directly in the database.
}
# Validate the changer address.
-my $match = Param('emailregexp');
+my $match = Bugzilla->params->{'emailregexp'};
if ($changer !~ /$match/) {
print STDERR "Changer \"$changer\" doesn't match email regular expression.\n";
usage();
###
# Get current LDAP users
###
-my $LDAPserver = Param("LDAPserver");
+my $LDAPserver = Bugzilla->params->{"LDAPserver"};
if ($LDAPserver eq "") {
print "No LDAP server defined in bugzilla preferences.\n";
exit;
exit;
}
my $mesg;
-if (Param("LDAPbinddn")) {
- my ($LDAPbinddn,$LDAPbindpass) = split(":",Param("LDAPbinddn"));
+if (Bugzilla->params->{"LDAPbinddn"}) {
+ my ($LDAPbinddn,$LDAPbindpass) = split(":",Bugzilla->params->{"LDAPbinddn"});
$mesg = $LDAPconn->bind($LDAPbinddn, password => $LDAPbindpass);
}
else {
}
# We've got our anonymous bind; let's look up the users.
-$mesg = $LDAPconn->search( base => Param("LDAPBaseDN"),
+$mesg = $LDAPconn->search( base => Bugzilla->params->{"LDAPBaseDN"},
scope => "sub",
- filter => '(&(' . Param("LDAPuidattribute") . "=*)" . Param("LDAPfilter") . ')',
+ filter => '(&(' . Bugzilla->params->{"LDAPuidattribute"} . "=*)" . Bugzilla->params->{"LDAPfilter"} . ')',
);
while( my ($key, $value) = each(%$val) ) {
- my $login_name = @$value{Param("LDAPmailattribute")};
+ my $login_name = @$value{Bugzilla->params->{"LDAPmailattribute"}};
my $realname = @$value{"cn"};
# no mail entered? go to next
# no cn entered? use uid instead
if(! defined $realname) {
- $realname = @$value{Param("LDAPuidattribute")};
+ $realname = @$value{Bugzilla->params->{"LDAPuidattribute"}};
}
my $login = shift @$login_name;
ThrowUserError("auth_cant_create_account");
}
-my $createexp = Param('createemailregexp');
+my $createexp = Bugzilla->params->{'createemailregexp'};
unless ($createexp) {
ThrowUserError("account_creation_disabled");
}
# Remove all those dupes under the threshold parameter.
# We do this, before the sorting, for performance reasons.
-my $threshold = Param("mostfreqthreshold");
+my $threshold = Bugzilla->params->{"mostfreqthreshold"};
while (my ($key, $value) = each %count) {
delete $count{$key} if ($value < $threshold);
action => "edit",
object => "classifications"});
-ThrowUserError("auth_classification_not_enabled") unless Param("useclassification");
+ThrowUserError("auth_classification_not_enabled")
+ unless Bugzilla->params->{"useclassification"};
#
# often used variables
{name => $comp_name});
my $default_assignee_id = login_to_id($default_assignee);
- my $default_qa_contact_id = Param('useqacontact') ?
+ my $default_qa_contact_id = Bugzilla->params->{'useqacontact'} ?
(login_to_id($default_qa_contact) || undef) : undef;
trick_taint($comp_name);
Bugzilla::Component::check_component($product, $comp_name);
if ($component->bug_count) {
- if (Param("allowbugdeletion")) {
+ if (Bugzilla->params->{"allowbugdeletion"}) {
foreach my $bug_id (@{$component->bug_ids}) {
my $bug = new Bugzilla::Bug($bug_id, $whoid);
$bug->remove_from_db();
$vars->{'updated_initialowner'} = 1;
}
- if (Param('useqacontact')
+ if (Bugzilla->params->{'useqacontact'}
&& $default_qa_contact ne $component_old->default_qa_contact->login) {
$dbh->do("UPDATE components SET initialqacontact = ?
WHERE id = ?", undef,
# Groups having a special role cannot be deleted.
my @special_groups;
foreach my $special_group ('chartgroup', 'insidergroup', 'timetrackinggroup') {
- if ($name eq Param($special_group)) {
+ if ($name eq Bugzilla->params->{$special_group}) {
push(@special_groups, $special_group);
}
}
# Groups having a special role cannot be deleted.
my @special_groups;
foreach my $special_group ('chartgroup', 'insidergroup', 'timetrackinggroup') {
- if ($name eq Param($special_group)) {
+ if ($name eq Bugzilla->params->{$special_group}) {
push(@special_groups, $special_group);
}
}
# these parameters too.
my $update_params = 0;
foreach my $group ('chartgroup', 'insidergroup', 'timetrackinggroup') {
- if ($cgi->param('oldname') eq Param($group)) {
+ if ($cgi->param('oldname') eq Bugzilla->params->{$group}) {
SetParam($group, $name);
$update_params = 1;
}
}
my $cansee = $cgi->param("cansee-$v") || 0;
- if (Param("usevisibilitygroups")
+ if (Bugzilla->params->{"usevisibilitygroups"}
&& ($cgi->param("oldcansee-$v") != $cansee)) {
$chgs = 1;
if ($cansee != 0) {
my $changed;
if ($i->{'type'} eq 'm') {
- my @old = sort @{Param($name)};
+ my @old = sort @{Bugzilla->params->{$name}};
my @new = sort @$value;
if (scalar(@old) != scalar(@new)) {
$changed = 1;
}
}
} else {
- $changed = ($value eq Param($name))? 0 : 1;
+ $changed = ($value eq Bugzilla->params->{$name})? 0 : 1;
}
if ($changed) {
# classifications enabled)
#
-if (Param('useclassification')
+if (Bugzilla->params->{'useclassification'}
&& !$classification_name
&& !$product_name)
{
if (!$action && !$product_name) {
my $products;
- if (Param('useclassification')) {
+ if (Bugzilla->params->{'useclassification'}) {
my $classification =
Bugzilla::Classification::check_classification($classification_name);
if ($action eq 'add') {
- if (Param('useclassification')) {
+ if (Bugzilla->params->{'useclassification'}) {
my $classification =
Bugzilla::Classification::check_classification($classification_name);
$vars->{'classification'} = $classification;
# Cleanups and validity checks
my $classification_id = 1;
- if (Param('useclassification')) {
+ if (Bugzilla->params->{'useclassification'}) {
my $classification =
Bugzilla::Classification::check_classification($classification_name);
$classification_id = $classification->id;
# If we're using bug groups, then we need to create a group for this
# product as well. -JMR, 2/16/00
- if (Param("makeproductgroups")) {
+ if (Bugzilla->params->{"makeproductgroups"}) {
# Next we insert into the groups table
my $productgroup = $product->name;
while (new Bugzilla::Group({name => $productgroup})) {
(group_id, product_id, entry, membercontrol,
othercontrol, canedit)
VALUES (?, ?, ?, ?, ?, ?)',
- undef, ($gid, $product->id, Param('useentrygroupdefault'),
+ undef, ($gid, $product->id,
+ Bugzilla->params->{'useentrygroupdefault'},
CONTROLMAPDEFAULT, CONTROLMAPNA, 0));
}
$user->can_see_product($product->name)
|| ThrowUserError('product_access_denied', {product => $product->name});
- if (Param('useclassification')) {
+ if (Bugzilla->params->{'useclassification'}) {
my $classification =
Bugzilla::Classification::check_classification($classification_name);
if ($classification->id != $product->classification_id) {
$vars->{'product'} = $product;
- if (Param('useclassification')) {
+ if (Bugzilla->params->{'useclassification'}) {
my $classification =
Bugzilla::Classification::check_classification($classification_name);
if ($classification->id != $product->classification_id) {
}
if ($product->bug_count) {
- if (Param("allowbugdeletion")) {
+ if (Bugzilla->params->{"allowbugdeletion"}) {
foreach my $bug_id (@{$product->bug_ids}) {
my $bug = new Bugzilla::Bug($bug_id, $whoid);
$bug->remove_from_db();
$user->can_see_product($product->name)
|| ThrowUserError('product_access_denied', {product => $product->name});
- if (Param('useclassification')) {
+ if (Bugzilla->params->{'useclassification'}) {
my $classification;
if (!$classification_name) {
$classification =
$user->can_see_product($product_old->name)
|| ThrowUserError('product_access_denied', {product => $product_old->name});
- if (Param('useclassification')) {
+ if (Bugzilla->params->{'useclassification'}) {
my $classification;
if (!$classification_name) {
$classification =
}
# Only update milestone related stuff if 'usetargetmilestone' is on.
- if (Param('usetargetmilestone')) {
+ if (Bugzilla->params->{'usetargetmilestone'}) {
my $milestone = new Bugzilla::Milestone($product_old->id,
$defaultmilestone);
$group || ThrowUserError('invalid_group_ID');
}
- if (!$editusers && Param('usevisibilitygroups')) {
+ if (!$editusers && Bugzilla->params->{'usevisibilitygroups'}) {
# Show only users in visible groups.
$visibleGroups = $user->visible_groups_as_string();
my $otherUser = check_user($otherUserID, $otherUserLogin);
$otherUserID = $otherUser->id;
- Param('allowuserdeletion') || ThrowUserError('users_deletion_disabled');
+ Bugzilla->params->{'allowuserdeletion'}
+ || ThrowUserError('users_deletion_disabled');
$editusers || ThrowUserError('auth_failure', {group => "editusers",
action => "delete",
object => "users"});
'whine_queries WRITE',
'whine_events WRITE');
- Param('allowuserdeletion')
+ Bugzilla->params->{'allowuserdeletion'}
|| ThrowUserError('users_deletion_disabled');
$editusers || ThrowUserError('auth_failure',
{group => "editusers",
{Slice =>{}});
$vars->{'field'} = $field;
$vars->{'values'} = $fieldvalues;
- $vars->{'default'} = Param($defaults{$field});
+ $vars->{'default'} = Bugzilla->params->{$defaults{$field}};
$template->process("admin/fieldvalues/list.html.tmpl",
$vars)
|| ThrowTemplateError($template->error());
#
if ($action eq 'delete') {
ValueMustExist($field, $value);
- if ($value eq Param($defaults{$field})) {
+ if ($value eq Bugzilla->params->{$defaults{$field}}) {
ThrowUserError('fieldvalue_is_default', {field => $field,
value => $value,
param_name => $defaults{$field}})
# This update is done while tables are unlocked due to the
# annoying calls in Bugzilla/Config/Common.pm.
if ($value ne $valueold
- && $valueold eq Param($defaults{$field}))
+ && $valueold eq Bugzilla->params->{$defaults{$field}})
{
SetParam($defaults{$field}, $value);
WriteParams();
if ($can_mail_others && $mailto) {
if ($mailto_type == MAILTO_USER) {
# detaint
- my $emailregexp = Param('emailregexp');
+ my $emailregexp = Bugzilla->params->{'emailregexp'};
if ($mailto =~ /($emailregexp)/) {
$mailto_id = login_to_id($1);
}
my @enterable_products = @{$user->get_enterable_products};
ThrowUserError('no_products') unless scalar(@enterable_products);
- my $classification = Param('useclassification') ?
+ my $classification = Bugzilla->params->{'useclassification'} ?
scalar($cgi->param('classification')) : '__all';
unless ($classification) {
my @platform;
- if (Param('defaultplatform')) {
- @platform = Param('defaultplatform');
+ if (Bugzilla->params->{'defaultplatform'}) {
+ @platform = Bugzilla->params->{'defaultplatform'};
} else {
# If @platform is a list, this function will return the first
# item in the list that is a valid platform choice. If
my @os;
- if (Param('defaultopsys')) {
- @os = Param('defaultopsys');
+ if (Bugzilla->params->{'defaultopsys'}) {
+ @os = Bugzilla->params->{'defaultopsys'};
} else {
# This function will return the first
# item in @os that is a valid platform choice. If
$vars->{'commentprivacy'} = 0;
if ( !($isprivate) ||
- ( ( Param("insidergroup") ) &&
- ( UserInGroup(Param("insidergroup")) ) )
+ ( ( Bugzilla->params->{"insidergroup"} ) &&
+ ( UserInGroup(Bugzilla->params->{"insidergroup"}) ) )
) {
$vars->{'comment'} = $cloned_bug->{'longdescs'}->[0]->{'body'};
$vars->{'commentprivacy'} = $isprivate;
else {
$default{'component_'} = formvalue('component');
- $default{'priority'} = formvalue('priority', Param('defaultpriority'));
- $default{'bug_severity'} = formvalue('bug_severity', Param('defaultseverity'));
+ $default{'priority'} = formvalue('priority', Bugzilla->params->{'defaultpriority'});
+ $default{'bug_severity'} = formvalue('bug_severity', Bugzilla->params->{'defaultseverity'});
$default{'rep_platform'} = pickplatform();
$default{'op_sys'} = pickos();
}
# Get list of milestones.
-if ( Param('usetargetmilestone') ) {
+if ( Bugzilla->params->{'usetargetmilestone'} ) {
$vars->{'target_milestone'} = [map($_->name, @{$product->milestones})];
if (formvalue('target_milestone')) {
$default{'target_milestone'} = formvalue('target_milestone');
our $bugtotal;
my $xml;
my $dbh = Bugzilla->dbh;
+my $params = Bugzilla->params;
my ($timestamp) = $dbh->selectrow_array("SELECT NOW()");
###############################################################################
my $subject = shift;
my $message = shift;
my @recipients = @_;
- my $from = Param("moved-from-address");
+ my $from = $params->{"moved-from-address"};
$from =~ s/@/\@/g;
foreach my $to (@recipients){
my $subject = "Bug import error: $reason";
my $message = "Cannot import these bugs because $reason ";
$message .= "\n\nPlease re-open the original bug.\n" if ($errtype);
- $message .= "For more info, contact " . Param("maintainer") . ".\n";
- my @to = ( Param("maintainer"), $exporter);
+ $message .= "For more info, contact " . $params->{"maintainer"} . ".\n";
+ my @to = ( $params->{"maintainer"}, $exporter);
Debug( $message, ERR_LEVEL );
MailMessage( $subject, $message, @to );
exit;
}
Error( "no maintainer", "REOPEN", $exporter ) unless ($maintainer);
Error( "no exporter", "REOPEN", $exporter ) unless ($exporter);
- Error( "bug importing is disabled here", undef, $exporter ) unless ( Param("move-enabled") );
+ Error( "bug importing is disabled here", undef, $exporter ) unless ( $params->{"move-enabled"} );
Error( "invalid exporter: $exporter", "REOPEN", $exporter ) if ( !login_to_id($exporter) );
Error( "no urlbase set", "REOPEN", $exporter ) unless ($urlbase);
my $def_product =
- new Bugzilla::Product( { name => Param("moved-default-product") } )
+ new Bugzilla::Product( { name => $params->{"moved-default-product"} } )
|| Error("Cannot import these bugs because an invalid default
product was defined for the target db."
- . Param("maintainer") . " needs to fix the definitions of
+ . $params->{"maintainer"} . " needs to fix the definitions of
moved-default-product. \n", "REOPEN", $exporter);
my $def_component = new Bugzilla::Component(
{
product_id => $def_product->id,
- name => Param("moved-default-component")
+ name => $params->{"moved-default-component"}
})
|| Error("Cannot import these bugs because an invalid default
component was defined for the target db."
- . Param("maintainer") . " needs to fix the definitions of
+ . $params->{"maintainer"} . " needs to fix the definitions of
moved-default-component.\n", "REOPEN", $exporter);
}
$long_desc{'isprivate'} = $comment->{'att'}->{'isprivate'} || 0;
# if one of the comments is private we need to set this flag
- if ( $long_desc{'isprivate'} && $exporter->in_group(Param('insidergroup'))) {
+ if ( $long_desc{'isprivate'} && $exporter->in_group($params->{'insidergroup'})) {
$private = 1;
}
my $data = $comment->field('thetext');
$comments .= "\n\n--- Bug imported by $exporter_login ";
$comments .= time2str( "%Y-%m-%d %H:%M", time ) . " ";
- $comments .= Param('timezone');
+ $comments .= $params->{'timezone'};
$comments .= " ---\n\n";
$comments .= "This bug was previously known as _bug_ $bug_fields{'bug_id'} at ";
$comments .= $urlbase . "show_bug.cgi?id=" . $bug_fields{'bug_id'} . "\n";
# Product and Component if there is no valid default product and
# component defined in the parameters, we wouldn't be here
my $def_product =
- new Bugzilla::Product( { name => Param("moved-default-product") } );
+ new Bugzilla::Product( { name => $params->{"moved-default-product"} } );
my $def_component = new Bugzilla::Component(
{
product_id => $def_product->id,
- name => Param("moved-default-component")
+ name => $params->{"moved-default-component"}
}
);
my $product;
}
# Milestone
- if ( Param("usetargetmilestone") ) {
+ if ( $params->{"usetargetmilestone"} ) {
my $milestone =
new Bugzilla::Milestone( $product->id,
$bug_fields{'target_milestone'} );
push( @values, $bug_fields{'bug_severity'} );
}
else {
- push( @values, Param('defaultseverity') );
+ push( @values, $params->{'defaultseverity'} );
$err .= "Unknown severity ";
$err .= ( defined $bug_fields{'bug_severity'} )
? $bug_fields{'bug_severity'}
: "unknown";
$err .= ". Setting to default severity \"";
- $err .= Param('defaultseverity') . "\".\n";
+ $err .= $params->{'defaultseverity'} . "\".\n";
}
push( @query, "bug_severity" );
push( @values, $bug_fields{'priority'} );
}
else {
- push( @values, Param('defaultpriority') );
+ push( @values, $params->{'defaultpriority'} );
$err .= "Unknown priority ";
$err .= ( defined $bug_fields{'priority'} )
? $bug_fields{'priority'}
: "unknown";
$err .= ". Setting to default priority \"";
- $err .= Param('defaultpriority') . "\".\n";
+ $err .= $params->{'defaultpriority'} . "\".\n";
}
push( @query, "priority" );
push( @values, $bug_fields{'rep_platform'} );
}
else {
- push( @values, Param('defaultplatform') );
+ push( @values, $params->{'defaultplatform'} );
$err .= "Unknown platform ";
$err .= ( defined $bug_fields{'rep_platform'} )
? $bug_fields{'rep_platform'}
: "unknown";
$err .=". Setting to default platform \"";
- $err .= Param('defaultplatform') . "\".\n";
+ $err .= $params->{'defaultplatform'} . "\".\n";
}
push( @query, "rep_platform" );
push( @values, $bug_fields{'op_sys'} );
}
else {
- push( @values, Param('defaultopsys') );
+ push( @values, $params->{'defaultopsys'} );
$err .= "Unknown operating system ";
$err .= ( defined $bug_fields{'op_sys'} )
? $bug_fields{'op_sys'}
: "unknown";
- $err .= ". Setting to default OS \"" . Param('defaultopsys') . "\".\n";
+ $err .= ". Setting to default OS \"" . $params->{'defaultopsys'} . "\".\n";
}
push( @query, "op_sys" );
# Process time fields
- if ( Param("timetrackinggroup") ) {
+ if ( $params->{"timetrackinggroup"} ) {
my $date = format_time( $bug_fields{'deadline'}, "%Y-%m-%d" )
|| undef;
push( @values, $date );
}
}
- if ( Param("useqacontact") ) {
+ if ( $params->{"useqacontact"} ) {
my $qa_contact;
push( @query, "qa_contact" );
if ( ( defined $bug_fields{'qa_contact'})
$err .= "No attachment ID specified, dropping attachment\n";
next;
}
- if (!$exporter->in_group(Param('insidergroup')) && $att->{'isprivate'}){
+ if (!$exporter->in_group($params->{'insidergroup'}) && $att->{'isprivate'}){
$err .= "Exporter not in insidergroup and attachment marked private.\n";
$err .= " Marking attachment public\n";
$att->{'isprivate'} = 0;
# Insert longdesc and append any errors
my $worktime = $bug_fields{'actual_time'} || 0.0;
- $worktime = 0.0 if (!$exporter->in_group(Param('timetrackinggroup')));
+ $worktime = 0.0 if (!$exporter->in_group($params->{'timetrackinggroup'}));
$long_description .= "\n" . $comments;
if ($err) {
$long_description .= "\n$err\n";
$log .= "Bug ${urlbase}show_bug.cgi?id=$bug_fields{'bug_id'} ";
$log .= "imported as bug $id.\n";
- $log .= Param("urlbase") . "show_bug.cgi?id=$id\n\n";
+ $log .= $params->{"urlbase"} . "show_bug.cgi?id=$id\n\n";
if ($err) {
$log .= "The following problems were encountered while creating bug $id.\n";
$log .= $err;
my $log = join("\n\n", @logs);
$log .= "\n\nImported $bugtotal bug(s) from $urlbase,\n sent by $exporter.\n";
my $subject = "$bugtotal Bug(s) successfully moved from $urlbase to "
- . Param("urlbase");
+ . $params->{"urlbase"};
my @to = ($exporter, $maintainer);
MailMessage( $subject, $log, @to );
###############################################################################
my $cgi = Bugzilla->cgi;
-# Force to use HTTPS unless Param('ssl') equals 'never'.
+# Force to use HTTPS unless Bugzilla->params->{'ssl'} equals 'never'.
# This is required because the user may want to log in from here.
-if (Param('sslbase') ne '' and Param('ssl') ne 'never') {
- $cgi->require_https(Param('sslbase'));
+if (Bugzilla->params->{'sslbase'} ne '' and Bugzilla->params->{'ssl'} ne 'never') {
+ $cgi->require_https(Bugzilla->params->{'sslbase'});
}
my $template = Bugzilla->template;
# Check that if required a description has been provided
# This has to go somewhere after 'maketemplate'
# or it breaks bookmarks with no comments.
-if (Param("commentoncreate") && !trim($cgi->param('comment'))) {
+if (Bugzilla->params->{"commentoncreate"} && !trim($cgi->param('comment'))) {
ThrowUserError("description_required");
}
"bug_status", "everconfirmed", "bug_file_loc", "short_desc",
"target_milestone", "status_whiteboard");
-if (Param("usebugaliases")) {
+if (Bugzilla->params->{"usebugaliases"}) {
my $alias = trim($cgi->param('alias') || "");
if ($alias ne "") {
ValidateBugAlias($alias);
}
# Retrieve the default QA contact if the field is empty
-if (Param("useqacontact")) {
+if (Bugzilla->params->{"useqacontact"}) {
my $qa_contact;
if (!UserInGroup("editbugs") || !defined $cgi->param('qa_contact')
|| trim($cgi->param('qa_contact')) eq "") {
$cgi->param(-name => 'target_milestone', -value => $defaultmilestone);
}
-if (!Param('letsubmitterchoosepriority')) {
- $cgi->param(-name => 'priority', -value => Param('defaultpriority'));
+if (!Bugzilla->params->{'letsubmitterchoosepriority'}) {
+ $cgi->param(-name => 'priority', -value => Bugzilla->params->{'defaultpriority'});
}
# Some more sanity checking
}
}
-if (Param("strict_isolation")) {
+if (Bugzilla->params->{"strict_isolation"}) {
my @blocked_users = ();
my %related_users = %ccids;
$related_users{$cgi->param('assigned_to')} = 1;
- if (Param('useqacontact') && $cgi->param('qa_contact')) {
+ if (Bugzilla->params->{'useqacontact'} && $cgi->param('qa_contact')) {
$related_users{$cgi->param('qa_contact')} = 1;
}
foreach my $pid (keys %related_users) {
my $deadline;
# Time Tracking
-if (UserInGroup(Param("timetrackinggroup")) &&
+if (UserInGroup(Bugzilla->params->{"timetrackinggroup"}) &&
defined $cgi->param('estimated_time')) {
$est_time = $cgi->param('estimated_time');
push (@fields_values, $est_time, $est_time);
-if ((UserInGroup(Param("timetrackinggroup"))) && ($cgi->param('deadline'))) {
+if ( UserInGroup(Bugzilla->params->{"timetrackinggroup"})
+ && $cgi->param('deadline') )
+{
validate_date($cgi->param('deadline'))
|| ThrowUserError('illegal_date', {date => $cgi->param('deadline'),
format => 'YYYY-MM-DD'});
# Add the initial comment, allowing for the fact that it may be private
my $privacy = 0;
-if (Param("insidergroup") && UserInGroup(Param("insidergroup"))) {
+if (Bugzilla->params->{"insidergroup"}
+ && UserInGroup(Bugzilla->params->{"insidergroup"}))
+{
$privacy = $cgi->param('commentprivacy') ? 1 : 0;
}
}
}
-if (UserInGroup(Param('timetrackinggroup'))) {
+if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) {
my $wk_time = $cgi->param('work_time');
if ($cgi->param('comment') =~ /^\s*$/ && $wk_time && $wk_time != 0) {
ThrowUserError('comment_required');
# ValidateBugID is called without $field here so that it will
# throw an error if any of the changed bugs are not visible.
ValidateBugID($id);
- if (Param("strict_isolation")) {
+ if (Bugzilla->params->{"strict_isolation"}) {
my $deltabug = new Bugzilla::Bug($id, $user->id);
if (!$user->can_edit_product($deltabug->{'product_id'})) {
$vars->{'field'} = $field;
my ($function) = (@_);
# Param is 1 if comment should be added !
- my $ret = Param( "commenton" . $function );
+ my $ret = Bugzilla->params->{ "commenton" . $function };
# Allow without comment in case of undefined Params.
$ret = 0 unless ( defined( $ret ));
my $mok = 1; # so it won't affect the 'if' statement if milestones aren't used
my @milestone_names = ();
- if ( Param("usetargetmilestone") ) {
+ if ( Bugzilla->params->{"usetargetmilestone"} ) {
defined($cgi->param('target_milestone'))
|| ThrowCodeError('undefined_field', { field => 'target_milestone' });
if ($cok) {
$defaults{'component'} = $cgi->param('component');
}
- if (Param("usetargetmilestone")) {
+ if (Bugzilla->params->{"usetargetmilestone"}) {
$vars->{'use_target_milestone'} = 1;
$vars->{'milestones'} = \@milestone_names;
if ($mok) {
[map($_->name, @{$prod_obj->components})]);
check_field('version', scalar $cgi->param('version'),
[map($_->name, @{$prod_obj->versions})]);
- if ( Param("usetargetmilestone") ) {
+ if ( Bugzilla->params->{"usetargetmilestone"} ) {
check_field('target_milestone', scalar $cgi->param('target_milestone'),
[map($_->name, @{$prod_obj->milestones})]);
}
my $action = trim($cgi->param('action') || '');
-if ($action eq Param('move-button-text')) {
- Param('move-enabled') || ThrowUserError("move_bugs_disabled");
+if ($action eq Bugzilla->params->{'move-button-text'}) {
+ Bugzilla->params->{'move-enabled'} || ThrowUserError("move_bugs_disabled");
$user->is_mover || ThrowUserError("auth_failure", {action => 'move',
object => 'bugs'});
if (defined $cgi->param('comment') && $cgi->param('comment') !~ /^\s*$/) {
$comment = $cgi->param('comment') . "\n\n";
}
- $comment .= "Bug moved to " . Param('move-to-url') . ".\n\n";
+ $comment .= "Bug moved to " . Bugzilla->params->{'move-to-url'} . ".\n\n";
$comment .= "If the move succeeded, " . $user->login . " will receive a mail\n";
$comment .= "containing the number of the new bug in the other database.\n";
$comment .= "If all went well, please mark this bug verified, and paste\n";
$vars->{'header_done'} = 1;
}
# Prepare and send all data about these bugs to the new database
- my $to = Param('move-to-address');
+ my $to = Bugzilla->params->{'move-to-address'};
$to =~ s/@/\@/;
- my $from = Param('moved-from-address');
+ my $from = Bugzilla->params->{'moved-from-address'};
$from =~ s/@/\@/;
my $msg = "To: $to\n";
$msg .= "From: Bugzilla <" . $from . ">\n";
umask(0);
sub _remove_remaining_time {
- if (UserInGroup(Param('timetrackinggroup'))) {
+ if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) {
if ( defined $cgi->param('remaining_time')
&& $cgi->param('remaining_time') > 0 )
{
# If this installation uses bug aliases, and the user is changing the alias,
# add this change to the query.
-if (Param("usebugaliases") && defined $cgi->param('alias')) {
+if (Bugzilla->params->{"usebugaliases"} && defined $cgi->param('alias')) {
my $alias = trim($cgi->param('alias'));
# Since aliases are unique (like bug numbers), they can only be changed
}
}
-if (defined $cgi->param('id') &&
- (Param("insidergroup") && UserInGroup(Param("insidergroup")))) {
+if ( defined $cgi->param('id') &&
+ (Bugzilla->params->{"insidergroup"}
+ && UserInGroup(Bugzilla->params->{"insidergroup"})) )
+{
my $sth = $dbh->prepare('UPDATE longdescs SET isprivate = ?
WHERE bug_id = ? AND bug_when = ?');
# The QA contact cannot be deleted from show_bug.cgi for a single bug!
if ($name ne $cgi->param('dontchange')) {
$qacontact = login_to_id($name, THROW_ERROR) if ($name ne "");
- if ($qacontact && Param("strict_isolation")) {
+ if ($qacontact && Bugzilla->params->{"strict_isolation"}) {
$usercache{$qacontact} ||= Bugzilla::User->new($qacontact);
my $qa_user = $usercache{$qacontact};
foreach my $product_id (@newprod_ids) {
/^accept$/ && CheckonComment( "accept" ) && do {
DoConfirm();
ChangeStatus('ASSIGNED');
- if (Param("usetargetmilestone") && Param("musthavemilestoneonaccept")) {
+ if (Bugzilla->params->{"usetargetmilestone"}
+ && Bugzilla->params->{"musthavemilestoneonaccept"})
+ {
$requiremilestone = 1;
}
last SWITCH;
Bugzilla::Bug->settable_resolutions);
# don't resolve as fixed while still unresolved blocking bugs
- if (Param("noresolveonopenblockers")
+ if (Bugzilla->params->{"noresolveonopenblockers"}
&& $cgi->param('resolution') eq 'FIXED')
{
my @dependencies = Bugzilla::Bug::CountOpenDependencies(@idlist);
if (defined $cgi->param('assigned_to')
&& trim($cgi->param('assigned_to')) ne "") {
$assignee = login_to_id(trim($cgi->param('assigned_to')), THROW_ERROR);
- if (Param("strict_isolation")) {
+ if (Bugzilla->params->{"strict_isolation"}) {
$usercache{$assignee} ||= Bugzilla::User->new($assignee);
my $assign_user = $usercache{$assignee};
foreach my $product_id (@newprod_ids) {
}
# Process data for Time Tracking fields
-if (UserInGroup(Param('timetrackinggroup'))) {
+if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) {
foreach my $field ("estimated_time", "remaining_time") {
if (defined $cgi->param($field)) {
my $er_time = trim($cgi->param($field));
return 0;
}
-if (Param("strict_isolation")) {
+if (Bugzilla->params->{"strict_isolation"}) {
my @blocked_cc = ();
foreach my $pid (keys %cc_add) {
$usercache{$pid} ||= Bugzilla::User->new($pid);
}
}
-if ($prod_changed && Param("strict_isolation")) {
+if ($prod_changed && Bugzilla->params->{"strict_isolation"}) {
my $sth_cc = $dbh->prepare("SELECT who
FROM cc
WHERE bug_id = ?");
undef, $new_comp_id);
$query .= ", assigned_to = ?";
push(@bug_values, $assignee);
- if (Param("useqacontact")) {
+ if (Bugzilla->params->{"useqacontact"}) {
$qacontact = $dbh->selectrow_array('SELECT initialqacontact
FROM components
WHERE components.id = ?',
# email addresses into their corresponding IDs;
# - update $newhash{'bug_status'} to its real state if the bug
# is in the unconfirmed state.
- $formhash{'qa_contact'} = $qacontact if Param('useqacontact');
+ $formhash{'qa_contact'} = $qacontact if Bugzilla->params->{'useqacontact'};
if ($cgi->param('knob') eq 'reassignbycomponent'
|| $cgi->param('knob') eq 'reassign') {
$formhash{'assigned_to'} = $assignee;
$timestamp = $dbh->selectrow_array(q{SELECT NOW()});
my $work_time;
- if (UserInGroup(Param('timetrackinggroup'))) {
+ if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) {
$work_time = $cgi->param('work_time');
if ($work_time) {
# AppendComment (called below) can in theory raise an error,
if ($userdefaultquery) {
PrefillForm($userdefaultquery);
} else {
- PrefillForm(Param("defaultquery"));
+ PrefillForm(Bugzilla->params->{"defaultquery"});
}
}
$vars->{'product'} = \@selectable_products;
# Create data structures representing each classification
-if (Param('useclassification')) {
+if (Bugzilla->params->{'useclassification'}) {
$vars->{'classification'} = $user->get_selectable_classifications;
}
$vars->{'version'} = \@versions;
-if (Param('usetargetmilestone')) {
+if (Bugzilla->params->{'usetargetmilestone'}) {
$vars->{'target_milestone'} = \@milestones;
}
push @chfields, $val;
}
-if (UserInGroup(Param('timetrackinggroup'))) {
+if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) {
push @chfields, "work_time";
} else {
@chfields = grep($_ ne "estimated_time", @chfields);
}
if ($action eq "add") {
- (Param('quip_list_entry_control') eq "closed") &&
+ (Bugzilla->params->{'quip_list_entry_control'} eq "closed") &&
ThrowUserError("no_new_quips");
# Add the quip
- my $approved =
- (Param('quip_list_entry_control') eq "open") || (UserInGroup('admin')) || 0;
+ my $approved = (Bugzilla->params->{'quip_list_entry_control'} eq "open")
+ || UserInGroup('admin') || 0;
my $comment = $cgi->param("quip");
$comment || ThrowUserError("need_quip");
trick_taint($comment); # Used in a placeholder below
my $form_group = validateGroup($cgi->param('group'));
my $attach_join_clause = "flags.attach_id = attachments.attach_id";
- if (Param("insidergroup") && !UserInGroup(Param("insidergroup"))) {
+ if (Bugzilla->params->{"insidergroup"}
+ && !UserInGroup(Bugzilla->params->{"insidergroup"}))
+ {
$attach_join_clause .= " AND attachments.isprivate < 1";
}
(ccmap.who IS NOT NULL AND cclist_accessible = 1) OR
(bugs.reporter = $userid AND bugs.reporter_accessible = 1) OR
(bugs.assigned_to = $userid) " .
- (Param('useqacontact') ? "OR
+ (Bugzilla->params->{'useqacontact'} ? "OR
(bugs.qa_contact = $userid))" : ")");
# Limit query to pending requests.
@fieldlist = $cgi->param("field");
}
-unless (UserInGroup(Param("timetrackinggroup"))) {
+unless (UserInGroup(Bugzilla->params->{"timetrackinggroup"})) {
@fieldlist = grep($_ !~ /_time$/, @fieldlist);
}
my ($fh, $filename) = File::Temp::tempfile("XXXXXXXXXX",
SUFFIX => '.dot',
DIR => $webdotdir);
-my $urlbase = Param('urlbase');
+my $urlbase = Bugzilla->params->{'urlbase'};
print $fh "digraph G {";
print $fh qq{
chmod 0777, $filename;
-my $webdotbase = Param('webdotbase');
+my $webdotbase = Bugzilla->params->{'webdotbase'};
if ($webdotbase =~ /^https?:/) {
# Remote dot server
Bugzilla->switch_to_shadow_db();
-UserInGroup(Param("timetrackinggroup"))
+UserInGroup(Bugzilla->params->{"timetrackinggroup"})
|| ThrowUserError("auth_failure", {group => "time-tracking",
action => "access",
object => "timetracking_summaries"});
($vars->{'realname'}) = $dbh->selectrow_array(
"SELECT realname FROM profiles WHERE userid = ?", undef, $user->id);
- if(Param('allowemailchange')
+ if(Bugzilla->params->{'allowemailchange'}
&& Bugzilla->user->authorizer->can_change_email) {
my @token = $dbh->selectrow_array(
"SELECT tokentype, issuedate + " .
}
}
- if(Param("allowemailchange") && $cgi->param('new_login_name')) {
+ if(Bugzilla->params->{"allowemailchange"} && $cgi->param('new_login_name')) {
my $old_login_name = $cgi->param('Bugzilla_login');
my $new_login_name = trim($cgi->param('new_login_name'));
###########################################################################
# User watching
###########################################################################
- if (Param("supportwatchers")) {
+ if (Bugzilla->params->{"supportwatchers"}) {
my $watched_ref = $dbh->selectcol_arrayref(
"SELECT profiles.login_name FROM watch INNER JOIN profiles" .
" ON watch.watched = profiles.userid" .
###########################################################################
# User watching
###########################################################################
- if (Param("supportwatchers") && defined $cgi->param('watchedusers')) {
+ if (Bugzilla->params->{"supportwatchers"}
+ && defined $cgi->param('watchedusers'))
+ {
# Just in case. Note that this much locking is actually overkill:
# we don't really care if anyone reads the watch table. So
# some small amount of contention could be gotten rid of by
show_user();
}
elsif ($action eq "vote") {
- record_votes() if Param('usevotes');
+ record_votes() if Bugzilla->params->{'usevotes'};
show_user();
}
else {
my $who = login_to_id($name, THROW_ERROR);
my $userid = $user->id;
- my $canedit = (Param('usevotes') && $userid == $who) ? 1 : 0;
+ my $canedit = (Bugzilla->params->{'usevotes'} && $userid == $who) ? 1 : 0;
$dbh->bz_lock_tables('bugs READ', 'products READ', 'votes WRITE',
'cc READ', 'bug_group_map READ', 'user_group_map READ',
# Send whines from the address in the 'maintainer' Parameter so that all
# Bugzilla-originated mail appears to come from a single address.
-my $fromaddress = Param('maintainer');
+my $fromaddress = Bugzilla->params->{'maintainer'};
-if ($fromaddress !~ Param('emailregexp')) {
+if ($fromaddress !~ Bugzilla->params->{'emailregexp'}) {
die "Cannot run. " .
"The maintainer email address has not been properly set!\n";
}
use Bugzilla::Util;
# Whining is disabled if whinedays is zero
-exit unless Param('whinedays') >= 1;
+exit unless Bugzilla->params->{'whinedays'} >= 1;
my $dbh = Bugzilla->dbh;
my $query = q{SELECT bug_id, short_desc, login_name
WHERE (bug_status = ? OR bug_status = ?)
AND } . $dbh->sql_to_days('NOW()') . " - " .
$dbh->sql_to_days('delta_ts') . " > " .
- Param('whinedays') .
+ Bugzilla->params->{'whinedays'} .
" ORDER BY bug_id";
my %bugs;