Commit b1f4cf8b authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 342869: Use Bugzilla->params everywhere except templates

Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=justdave
parent 49979b37
...@@ -413,7 +413,8 @@ sub _validate_filename { ...@@ -413,7 +413,8 @@ sub _validate_filename {
sub _validate_data { sub _validate_data {
my ($throw_error, $hr_vars) = @_; my ($throw_error, $hr_vars) = @_;
my $cgi = Bugzilla->cgi; 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 $maxsize *= 1024; # Convert from K
my $fh; my $fh;
# Skip uploading into a local variable if the user wants to upload huge # Skip uploading into a local variable if the user wants to upload huge
...@@ -439,7 +440,7 @@ sub _validate_data { ...@@ -439,7 +440,7 @@ sub _validate_data {
# makes for a quick way to eat up disk space. Let's compress them. # 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 # We do this before we check the size since the uncompressed version
# could easily be greater than maxattachmentsize. # could easily be greater than maxattachmentsize.
if (Param('convert_uncompressed_images') if (Bugzilla->params->{'convert_uncompressed_images'}
&& $cgi->param('contenttype') eq 'image/bmp') { && $cgi->param('contenttype') eq 'image/bmp') {
require Image::Magick; require Image::Magick;
my $img = Image::Magick->new(magick=>'bmp'); my $img = Image::Magick->new(magick=>'bmp');
...@@ -710,7 +711,7 @@ sub insert_attachment_for_bug { ...@@ -710,7 +711,7 @@ sub insert_attachment_for_bug {
open(AH, ">$attachdir/$hash/attachment.$attachid"); open(AH, ">$attachdir/$hash/attachment.$attachid");
binmode AH; binmode AH;
my $sizecount = 0; my $sizecount = 0;
my $limit = (Param("maxlocalattachment") * 1048576); my $limit = (Bugzilla->params->{"maxlocalattachment"} * 1048576);
while (<$fh>) { while (<$fh>) {
print AH $_; print AH $_;
$sizecount += length($_); $sizecount += length($_);
......
...@@ -44,8 +44,8 @@ sub new { ...@@ -44,8 +44,8 @@ sub new {
my $self = fields::new($class); my $self = fields::new($class);
$params ||= {}; $params ||= {};
$params->{Login} ||= Param('user_info_class') . ',Cookie'; $params->{Login} ||= Bugzilla->params->{'user_info_class'} . ',Cookie';
$params->{Verify} ||= Param('user_verify_class'); $params->{Verify} ||= Bugzilla->params->{'user_verify_class'};
$self->{_info_getter} = new Bugzilla::Auth::Login::Stack($params->{Login}); $self->{_info_getter} = new Bugzilla::Auth::Login::Stack($params->{Login});
$self->{_verifier} = new Bugzilla::Auth::Verify::Stack($params->{Verify}); $self->{_verifier} = new Bugzilla::Auth::Verify::Stack($params->{Verify});
......
...@@ -60,8 +60,10 @@ sub fail_nodata { ...@@ -60,8 +60,10 @@ sub fail_nodata {
my $template = Bugzilla->template; my $template = Bugzilla->template;
# Redirect to SSL if required # Redirect to SSL if required
if (Param('sslbase') ne '' and Param('ssl') ne 'never') { if (Bugzilla->params->{'sslbase'} ne ''
$cgi->require_https(Param('sslbase')); and Bugzilla->params->{'ssl'} ne 'never')
{
$cgi->require_https(Bugzilla->params->{'sslbase'});
} }
print $cgi->header(); print $cgi->header();
$template->process("account/auth/login.html.tmpl", $template->process("account/auth/login.html.tmpl",
......
...@@ -36,9 +36,9 @@ sub get_login_info { ...@@ -36,9 +36,9 @@ sub get_login_info {
my ($self) = @_; my ($self) = @_;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $env_id = $ENV{Param("auth_env_id")} || ''; my $env_id = $ENV{Bugzilla->params->{"auth_env_id"}} || '';
my $env_email = $ENV{Param("auth_env_email")} || ''; my $env_email = $ENV{Bugzilla->params->{"auth_env_email"}} || '';
my $env_realname = $ENV{Param("auth_env_realname")} || ''; my $env_realname = $ENV{Bugzilla->params->{"auth_env_realname"}} || '';
return { failure => AUTH_NODATA } if !$env_email; return { failure => AUTH_NODATA } if !$env_email;
......
...@@ -52,7 +52,7 @@ sub persist_login { ...@@ -52,7 +52,7 @@ sub persist_login {
my $ip_addr = $cgi->remote_addr; my $ip_addr = $cgi->remote_addr;
unless ($cgi->param('Bugzilla_restrictlogin') || unless ($cgi->param('Bugzilla_restrictlogin') ||
Param('loginnetmask') == 32) Bugzilla->params->{'loginnetmask'} == 32)
{ {
$ip_addr = get_netaddr($ip_addr); $ip_addr = get_netaddr($ip_addr);
} }
...@@ -70,8 +70,8 @@ sub persist_login { ...@@ -70,8 +70,8 @@ sub persist_login {
# Remember cookie only if admin has told so # Remember cookie only if admin has told so
# or admin didn't forbid it and user told to remember. # or admin didn't forbid it and user told to remember.
if ( Param('rememberlogin') eq 'on' || if ( Bugzilla->params->{'rememberlogin'} eq 'on' ||
(Param('rememberlogin') ne 'off' && (Bugzilla->params->{'rememberlogin'} ne 'off' &&
$cgi->param('Bugzilla_remember') && $cgi->param('Bugzilla_remember') &&
$cgi->param('Bugzilla_remember') eq 'on') ) $cgi->param('Bugzilla_remember') eq 'on') )
{ {
......
...@@ -85,7 +85,7 @@ sub check_credentials { ...@@ -85,7 +85,7 @@ sub check_credentials {
my $user_entry = $detail_result->shift_entry; my $user_entry = $detail_result->shift_entry;
my $mail_attr = Param("LDAPmailattribute"); my $mail_attr = Bugzilla->params->{"LDAPmailattribute"};
if ($mail_attr) { if ($mail_attr) {
if (!$user_entry->exists($mail_attr)) { if (!$user_entry->exists($mail_attr)) {
return { failure => AUTH_ERROR, return { failure => AUTH_ERROR,
...@@ -106,17 +106,19 @@ sub check_credentials { ...@@ -106,17 +106,19 @@ sub check_credentials {
sub _bz_search_params { sub _bz_search_params {
my ($username) = @_; my ($username) = @_;
return (base => Param("LDAPBaseDN"), return (base => Bugzilla->params->{"LDAPBaseDN"},
scope => "sub", scope => "sub",
filter => '(&(' . Param("LDAPuidattribute") . "=$username)" filter => '(&(' . Bugzilla->params->{"LDAPuidattribute"}
. Param("LDAPfilter") . ')'); . "=$username)"
. Bugzilla->params->{"LDAPfilter"} . ')');
} }
sub _bind_ldap_anonymously { sub _bind_ldap_anonymously {
my ($self) = @_; my ($self) = @_;
my $bind_result; my $bind_result;
if (Param("LDAPbinddn")) { if (Bugzilla->params->{"LDAPbinddn"}) {
my ($LDAPbinddn,$LDAPbindpass) = split(":",Param("LDAPbinddn")); my ($LDAPbinddn,$LDAPbindpass) =
split(":",Bugzilla->params->{"LDAPbinddn"});
$bind_result = $bind_result =
$self->ldap->bind($LDAPbinddn, password => $LDAPbindpass); $self->ldap->bind($LDAPbinddn, password => $LDAPbindpass);
} }
...@@ -136,7 +138,7 @@ sub ldap { ...@@ -136,7 +138,7 @@ sub ldap {
my ($self) = @_; my ($self) = @_;
return $self->{ldap} if $self->{ldap}; return $self->{ldap} if $self->{ldap};
my $server = Param("LDAPserver"); my $server = Bugzilla->params->{"LDAPserver"};
ThrowCodeError("ldap_server_not_defined") unless $server; ThrowCodeError("ldap_server_not_defined") unless $server;
my $port = DEFAULT_PORT; my $port = DEFAULT_PORT;
...@@ -166,7 +168,7 @@ sub ldap { ...@@ -166,7 +168,7 @@ sub ldap {
|| ThrowCodeError("ldap_connect_failed", { server => $conn_string }); || ThrowCodeError("ldap_connect_failed", { server => $conn_string });
# try to start TLS if needed # try to start TLS if needed
if (Param("LDAPstarttls")) { if (Bugzilla->params->{"LDAPstarttls"}) {
my $mesg = $self->{ldap}->start_tls(); my $mesg = $self->{ldap}->start_tls();
ThrowCodeError("ldap_start_tls_failed", { error => $mesg->error() }) ThrowCodeError("ldap_start_tls_failed", { error => $mesg->error() })
if $mesg->code(); if $mesg->code();
......
...@@ -298,10 +298,9 @@ sub fields { ...@@ -298,10 +298,9 @@ sub fields {
reporter assigned_to cc), reporter assigned_to cc),
# Conditional Fields # Conditional Fields
Param('useqacontact') ? "qa_contact" : (), Bugzilla->params->{'useqacontact'} ? "qa_contact" : (),
Param('timetrackinggroup') ? qw(estimated_time remaining_time Bugzilla->params->{'timetrackinggroup'} ?
actual_time deadline) qw(estimated_time remaining_time actual_time deadline) : (),
: (),
# Custom Fields # Custom Fields
Bugzilla->custom_field_names Bugzilla->custom_field_names
...@@ -346,7 +345,7 @@ sub actual_time { ...@@ -346,7 +345,7 @@ sub actual_time {
return $self->{'actual_time'} if exists $self->{'actual_time'}; return $self->{'actual_time'} if exists $self->{'actual_time'};
if ( $self->{'error'} || if ( $self->{'error'} ||
!Bugzilla->user->in_group(Param("timetrackinggroup")) ) { !Bugzilla->user->in_group(Bugzilla->params->{"timetrackinggroup"}) ) {
$self->{'actual_time'} = undef; $self->{'actual_time'} = undef;
return $self->{'actual_time'}; return $self->{'actual_time'};
} }
...@@ -492,7 +491,7 @@ sub qa_contact { ...@@ -492,7 +491,7 @@ sub qa_contact {
return $self->{'qa_contact'} if exists $self->{'qa_contact'}; return $self->{'qa_contact'} if exists $self->{'qa_contact'};
return undef if $self->{'error'}; 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'}); $self->{'qa_contact'} = new Bugzilla::User($self->{'qa_contact_id'});
} else { } else {
# XXX - This is somewhat inconsistent with the assignee/reporter # XXX - This is somewhat inconsistent with the assignee/reporter
...@@ -542,7 +541,8 @@ sub use_votes { ...@@ -542,7 +541,8 @@ sub use_votes {
$self->{'prod_obj'} ||= new Bugzilla::Product({name => $self->{'product'}}); $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 { sub groups {
...@@ -617,7 +617,7 @@ sub user { ...@@ -617,7 +617,7 @@ sub user {
return {} if $self->{'error'}; return {} if $self->{'error'};
my $user = Bugzilla->user; 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 # 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 # as if they can do anything. That's because we don't know why they
...@@ -629,7 +629,7 @@ sub user { ...@@ -629,7 +629,7 @@ sub user {
|| $user->in_group("editbugs"); || $user->in_group("editbugs");
my $canedit = $unknown_privileges my $canedit = $unknown_privileges
|| $user->id == $self->{assigned_to_id} || $user->id == $self->{assigned_to_id}
|| (Param('useqacontact') || (Bugzilla->params->{'useqacontact'}
&& $self->{'qa_contact_id'} && $self->{'qa_contact_id'}
&& $user->id == $self->{qa_contact_id}); && $user->id == $self->{qa_contact_id});
my $canconfirm = $unknown_privileges my $canconfirm = $unknown_privileges
...@@ -703,7 +703,7 @@ sub settable_resolutions { ...@@ -703,7 +703,7 @@ sub settable_resolutions {
# the ID of the bug if it exists or the undefined value if it doesn't. # the ID of the bug if it exists or the undefined value if it doesn't.
sub bug_alias_to_id { sub bug_alias_to_id {
my ($alias) = @_; my ($alias) = @_;
return undef unless Param("usebugaliases"); return undef unless Bugzilla->params->{"usebugaliases"};
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
trick_taint($alias); trick_taint($alias);
return $dbh->selectrow_array( return $dbh->selectrow_array(
...@@ -823,7 +823,7 @@ sub GetComments { ...@@ -823,7 +823,7 @@ sub GetComments {
while (my $comment_ref = $sth->fetchrow_hashref()) { while (my $comment_ref = $sth->fetchrow_hashref()) {
my %comment = %$comment_ref; my %comment = %$comment_ref;
$comment{'email'} .= Param('emailsuffix'); $comment{'email'} .= Bugzilla->params->{'emailsuffix'};
$comment{'name'} = $comment{'name'} || $comment{'email'}; $comment{'name'} = $comment{'name'} || $comment{'email'};
push (@comments, \%comment); push (@comments, \%comment);
...@@ -856,7 +856,9 @@ sub GetBugActivity { ...@@ -856,7 +856,9 @@ sub GetBugActivity {
# Only includes attachments the user is allowed to see. # Only includes attachments the user is allowed to see.
my $suppjoins = ""; my $suppjoins = "";
my $suppwhere = ""; my $suppwhere = "";
if (Param("insidergroup") && !UserInGroup(Param('insidergroup'))) { if (Bugzilla->params->{"insidergroup"}
&& !UserInGroup(Bugzilla->params->{'insidergroup'}))
{
$suppjoins = "LEFT JOIN attachments $suppjoins = "LEFT JOIN attachments
ON attachments.attach_id = bugs_activity.attach_id"; ON attachments.attach_id = bugs_activity.attach_id";
$suppwhere = "AND COALESCE(attachments.isprivate, 0) = 0"; $suppwhere = "AND COALESCE(attachments.isprivate, 0) = 0";
...@@ -901,7 +903,8 @@ sub GetBugActivity { ...@@ -901,7 +903,8 @@ sub GetBugActivity {
|| $fieldname eq 'work_time' || $fieldname eq 'work_time'
|| $fieldname eq 'deadline') || $fieldname eq 'deadline')
{ {
$activity_visible = UserInGroup(Param('timetrackinggroup')) ? 1 : 0; $activity_visible =
UserInGroup(Bugzilla->params->{'timetrackinggroup'}) ? 1 : 0;
} else { } else {
$activity_visible = 1; $activity_visible = 1;
} }
...@@ -1090,7 +1093,7 @@ sub RemoveVotes { ...@@ -1090,7 +1093,7 @@ sub RemoveVotes {
# been reduced or removed. # been reduced or removed.
my $vars = { my $vars = {
'to' => $name . Param('emailsuffix'), 'to' => $name . Bugzilla->params->{'emailsuffix'},
'bugid' => $id, 'bugid' => $id,
'reason' => $reason, 'reason' => $reason,
...@@ -1281,7 +1284,7 @@ sub check_can_change_field { ...@@ -1281,7 +1284,7 @@ sub check_can_change_field {
} }
# - change the priority (unless he could have set it originally) # - change the priority (unless he could have set it originally)
if ($field eq 'priority' if ($field eq 'priority'
&& !Param('letsubmitterchoosepriority')) && !Bugzilla->params->{'letsubmitterchoosepriority'})
{ {
$PrivilegesRequired = 2; $PrivilegesRequired = 2;
return 0; return 0;
......
...@@ -239,7 +239,8 @@ sub ProcessOneBug { ...@@ -239,7 +239,8 @@ sub ProcessOneBug {
my $diffpart = {}; my $diffpart = {};
if ($who ne $lastwho) { if ($who ne $lastwho) {
$lastwho = $who; $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 .= FormatTriple("What ", "Removed", "Added");
$diffheader .= ('-' x 76) . "\n"; $diffheader .= ('-' x 76) . "\n";
} }
...@@ -293,7 +294,7 @@ sub ProcessOneBug { ...@@ -293,7 +294,7 @@ sub ProcessOneBug {
$deptext .= $thisdiff; $deptext .= $thisdiff;
} }
$lastbug = $depbug; $lastbug = $depbug;
my $urlbase = Param("urlbase"); my $urlbase = Bugzilla->params->{"urlbase"};
$thisdiff = $thisdiff =
"\nBug $id depends on bug $depbug, which changed state.\n\n" . "\nBug $id depends on bug $depbug, which changed state.\n\n" .
"Bug $depbug Summary: $summary\n" . "Bug $depbug Summary: $summary\n" .
...@@ -352,7 +353,7 @@ sub ProcessOneBug { ...@@ -352,7 +353,7 @@ sub ProcessOneBug {
$recipients{$reporter}->{+REL_REPORTER} = BIT_DIRECT; $recipients{$reporter}->{+REL_REPORTER} = BIT_DIRECT;
# QA Contact # QA Contact
if (Param('useqacontact')) { if (Bugzilla->params->{'useqacontact'}) {
foreach (@qa_contacts) { foreach (@qa_contacts) {
# QA Contact can be blank; ignore it if so. # QA Contact can be blank; ignore it if so.
$recipients{$_}->{+REL_QA} = BIT_DIRECT if $_; $recipients{$_}->{+REL_QA} = BIT_DIRECT if $_;
...@@ -387,7 +388,7 @@ sub ProcessOneBug { ...@@ -387,7 +388,7 @@ sub ProcessOneBug {
} }
} }
if (Param("supportwatchers")) { if (Bugzilla->params->{"supportwatchers"}) {
# Find all those user-watching anyone on the current list, who is not # Find all those user-watching anyone on the current list, who is not
# on it already themselves. # on it already themselves.
my $involved = join(",", keys %recipients); my $involved = join(",", keys %recipients);
...@@ -444,9 +445,9 @@ sub ProcessOneBug { ...@@ -444,9 +445,9 @@ sub ProcessOneBug {
# If we are using insiders, and the comment is private, only send # If we are using insiders, and the comment is private, only send
# to insiders # to insiders
my $insider_ok = 1; my $insider_ok = 1;
$insider_ok = 0 if (Param("insidergroup") && $insider_ok = 0 if (Bugzilla->params->{"insidergroup"} &&
($anyprivate != 0) && ($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 # 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 # is something in @depbugs), and any of the depending bugs are not
...@@ -518,7 +519,7 @@ sub sendMail { ...@@ -518,7 +519,7 @@ sub sendMail {
} }
# Only send estimated_time if it is enabled and the user is in the group # Only send estimated_time if it is enabled and the user is in the group
if (($f ne 'estimated_time' && $f ne 'deadline') || if (($f ne 'estimated_time' && $f ne 'deadline') ||
$user->groups->{Param('timetrackinggroup')}) { $user->groups->{Bugzilla->params->{'timetrackinggroup'}}) {
my $desc = $fielddescription{$f}; my $desc = $fielddescription{$f};
$head .= FormatDouble($desc, $value); $head .= FormatDouble($desc, $value);
...@@ -539,12 +540,12 @@ sub sendMail { ...@@ -539,12 +540,12 @@ sub sendMail {
$diff->{'fieldname'} eq 'remaining_time' || $diff->{'fieldname'} eq 'remaining_time' ||
$diff->{'fieldname'} eq 'work_time' || $diff->{'fieldname'} eq 'work_time' ||
$diff->{'fieldname'} eq 'deadline')){ $diff->{'fieldname'} eq 'deadline')){
if ($user->groups->{Param("timetrackinggroup")}) { if ($user->groups->{Bugzilla->params->{"timetrackinggroup"}}) {
$add_diff = 1; $add_diff = 1;
} }
} elsif (($diff->{'isprivate'}) } elsif (($diff->{'isprivate'})
&& Param('insidergroup') && Bugzilla->params->{'insidergroup'}
&& !($user->groups->{Param('insidergroup')}) && !($user->groups->{Bugzilla->params->{'insidergroup'}})
) { ) {
$add_diff = 0; $add_diff = 0;
} else { } else {
...@@ -599,7 +600,7 @@ sub sendMail { ...@@ -599,7 +600,7 @@ sub sendMail {
if ( $newcomments =~ /Created an attachment \(/ ) { if ( $newcomments =~ /Created an attachment \(/ ) {
my $showattachurlbase = 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; $newcomments =~ s/(Created an attachment \(id=([0-9]+)\))/$1\n --> \(${showattachurlbase}$2\)/g;
} }
...@@ -639,7 +640,7 @@ sub sendMail { ...@@ -639,7 +640,7 @@ sub sendMail {
$substs{"changer"} = $values{'changer'}; $substs{"changer"} = $values{'changer'};
$substs{"changername"} = $values{'changername'}; $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/:\/\//\./; # Make the protocol look like part of the domain
$sitespec =~ s/^([^:\/]+):(\d+)/$1/; # Remove a port number, to relocate $sitespec =~ s/^([^:\/]+):(\d+)/$1/; # Remove a port number, to relocate
if ($2) { if ($2) {
...@@ -653,7 +654,7 @@ sub sendMail { ...@@ -653,7 +654,7 @@ sub sendMail {
$user->id . "$sitespec>"; $user->id . "$sitespec>";
} }
my $template = Param("newchangedmail"); my $template = Bugzilla->params->{"newchangedmail"};
my $msg = perform_substs($template, \%substs); my $msg = perform_substs($template, \%substs);
...@@ -667,7 +668,7 @@ sub MailPassword { ...@@ -667,7 +668,7 @@ sub MailPassword {
my ($login, $password) = (@_); my ($login, $password) = (@_);
my $template = Bugzilla->template; my $template = Bugzilla->template;
my $vars = { my $vars = {
mailaddress => $login . Param('emailsuffix'), mailaddress => $login . Bugzilla->params->{'emailsuffix'},
login => $login, login => $login,
password => $password }; password => $password };
my $msg; my $msg;
...@@ -716,10 +717,10 @@ sub get_comments_by_bug { ...@@ -716,10 +717,10 @@ sub get_comments_by_bug {
my ($who, $whoname, $when, $text, $isprivate, $already_wrapped) = @$_; my ($who, $whoname, $when, $text, $isprivate, $already_wrapped) = @$_;
if ($count) { if ($count) {
$result .= "\n\n--- Comment #$count from $whoname <$who" . $result .= "\n\n--- Comment #$count from $whoname <$who" .
Param('emailsuffix'). "> " . format_time($when) . Bugzilla->params->{'emailsuffix'}. "> "
" ---\n"; . format_time($when) . " ---\n";
} }
if ($isprivate > 0 && Param('insidergroup')) { if ($isprivate > 0 && Bugzilla->params->{'insidergroup'}) {
$anyprivate = 1; $anyprivate = 1;
} }
$result .= ($already_wrapped ? $text : wrap_comment($text)); $result .= ($already_wrapped ? $text : wrap_comment($text));
......
...@@ -280,7 +280,7 @@ Bugzilla::Config - Configuration parameters for Bugzilla ...@@ -280,7 +280,7 @@ Bugzilla::Config - Configuration parameters for Bugzilla
# Getting parameters # Getting parameters
use Bugzilla::Config; use Bugzilla::Config;
my $fooSetting = Param('foo'); my $fooSetting = Bugzilla->params->{'foo'};
# Administration functions # Administration functions
use Bugzilla::Config qw(:admin); use Bugzilla::Config qw(:admin);
...@@ -305,7 +305,7 @@ Parameters can be set, retrieved, and updated. ...@@ -305,7 +305,7 @@ Parameters can be set, retrieved, and updated.
=over 4 =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 Returns the Param with the specified name. Either a string, or, in the case
of multiple-choice parameters, an array reference. of multiple-choice parameters, an array reference.
......
...@@ -52,11 +52,13 @@ use constant BLOB_TYPE => DBI::SQL_BLOB; ...@@ -52,11 +52,13 @@ use constant BLOB_TYPE => DBI::SQL_BLOB;
##################################################################### #####################################################################
sub connect_shadow { 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"), return _connect($db_driver, $params->{"shadowdbhost"},
Param('shadowdb'), Param("shadowdbport"), $params->{'shadowdb'}, $params->{"shadowdbport"},
Param("shadowdbsock"), $db_user, $db_pass); $params->{"shadowdbsock"}, $db_user, $db_pass);
} }
sub connect_main { sub connect_main {
...@@ -205,7 +207,7 @@ sub bz_get_field_defs { ...@@ -205,7 +207,7 @@ sub bz_get_field_defs {
my ($self) = @_; my ($self) = @_;
my $extra = ""; 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', " . $extra = "AND name NOT IN ('estimated_time', 'remaining_time', " .
"'work_time', 'percentage_complete', 'deadline')"; "'work_time', 'percentage_complete', 'deadline')";
} }
......
...@@ -305,8 +305,8 @@ sub validate { ...@@ -305,8 +305,8 @@ sub validate {
# the requestee isn't in the group of insiders who can see it. # the requestee isn't in the group of insiders who can see it.
if ($attach_id if ($attach_id
&& $cgi->param('isprivate') && $cgi->param('isprivate')
&& Param("insidergroup") && Bugzilla->params->{"insidergroup"}
&& !$requestee->in_group(Param("insidergroup"))) && !$requestee->in_group(Bugzilla->params->{"insidergroup"}))
{ {
ThrowUserError("flag_requestee_unauthorized_attachment", ThrowUserError("flag_requestee_unauthorized_attachment",
{ flag_type => $flag->{'type'}, { flag_type => $flag->{'type'},
...@@ -798,8 +798,8 @@ sub notify { ...@@ -798,8 +798,8 @@ sub notify {
next if ($bug->groups && !$ccuser->can_see_bug($bug->bug_id)); next if ($bug->groups && !$ccuser->can_see_bug($bug->bug_id));
next if $attachment_is_private next if $attachment_is_private
&& Param("insidergroup") && Bugzilla->params->{"insidergroup"}
&& !$ccuser->in_group(Param("insidergroup")); && !$ccuser->in_group(Bugzilla->params->{"insidergroup"});
push(@new_cc_list, $cc); push(@new_cc_list, $cc);
} }
$flag->{'type'}->{'cc_list'} = join(", ", @new_cc_list); $flag->{'type'}->{'cc_list'} = join(", ", @new_cc_list);
......
...@@ -398,9 +398,9 @@ sub validate { ...@@ -398,9 +398,9 @@ sub validate {
# Throw an error if the target is a private attachment and # Throw an error if the target is a private attachment and
# the requestee isn't in the group of insiders who can see it. # the requestee isn't in the group of insiders who can see it.
if ($attach_id if ($attach_id
&& Param("insidergroup") && Bugzilla->params->{"insidergroup"}
&& $cgi->param('isprivate') && $cgi->param('isprivate')
&& !$requestee->in_group(Param("insidergroup"))) && !$requestee->in_group(Bugzilla->params->{"insidergroup"}))
{ {
ThrowUserError("flag_requestee_unauthorized_attachment", ThrowUserError("flag_requestee_unauthorized_attachment",
{ flag_type => $flag_type, { flag_type => $flag_type,
......
...@@ -50,12 +50,15 @@ use MIME::Base64; ...@@ -50,12 +50,15 @@ use MIME::Base64;
sub MessageToMTA { sub MessageToMTA {
my ($msg) = (@_); 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 ($header, $body) = $msg =~ /(.*?\n)\n(.*)/s ? ($1, $2) : ('', $msg);
my $headers; 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); ($headers, $body) = encode_message($msg);
} else { } else {
my @header_lines = split(/\n/, $header); my @header_lines = split(/\n/, $header);
...@@ -65,7 +68,7 @@ sub MessageToMTA { ...@@ -65,7 +68,7 @@ sub MessageToMTA {
# Use trim to remove any whitespace (incl. newlines) # Use trim to remove any whitespace (incl. newlines)
my $from = trim($headers->get('from')); 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'; my $cmd = '|' . SENDMAIL_EXE . ' -t -i';
if ($from) { if ($from) {
# We're on Windows, thus no danger of command injection # We're on Windows, thus no danger of command injection
...@@ -82,23 +85,25 @@ sub MessageToMTA { ...@@ -82,23 +85,25 @@ sub MessageToMTA {
} }
my @args; my @args;
if (Param("mail_delivery_method") eq "sendmail") { if ($params->{"mail_delivery_method"} eq "sendmail") {
push @args, "-i"; push @args, "-i";
if ($from) { if ($from) {
push(@args, "-f$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"; push @args, "-ODeliveryMode=deferred";
} }
if (Param("mail_delivery_method") eq "smtp") { if ($params->{"mail_delivery_method"} eq "smtp") {
push @args, Server => Param("smtpserver"); push @args, Server => $params->{"smtpserver"};
if ($from) { if ($from) {
$ENV{'MAILADDRESS'} = $from; $ENV{'MAILADDRESS'} = $from;
} }
} }
my $mailer = new Mail::Mailer Param("mail_delivery_method"), @args; my $mailer = new Mail::Mailer($params->{"mail_delivery_method"}, @args);
if (Param("mail_delivery_method") eq "testfile") { if ($params->{"mail_delivery_method"} eq "testfile") {
$Mail::Mailer::testfile::config{outfile} = $Mail::Mailer::testfile::config{outfile} =
bz_locations()->{'datadir'} . '/mailer.testfile'; bz_locations()->{'datadir'} . '/mailer.testfile';
} }
......
...@@ -346,7 +346,7 @@ sub init { ...@@ -346,7 +346,7 @@ sub init {
my $sql_deadlinefrom; my $sql_deadlinefrom;
my $sql_deadlineto; my $sql_deadlineto;
if (Bugzilla->user->in_group(Param('timetrackinggroup'))){ if (Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'})){
my $deadlinefrom; my $deadlinefrom;
my $deadlineto; my $deadlineto;
...@@ -579,8 +579,8 @@ sub init { ...@@ -579,8 +579,8 @@ sub init {
# Add the longdescs table to the query so we can search comments. # Add the longdescs table to the query so we can search comments.
my $table = "longdescs_$chartid"; my $table = "longdescs_$chartid";
my $extra = ""; my $extra = "";
if (Param("insidergroup") if (Bugzilla->params->{"insidergroup"}
&& !UserInGroup(Param("insidergroup"))) && !UserInGroup(Bugzilla->params->{"insidergroup"}))
{ {
$extra = "AND $table.isprivate < 1"; $extra = "AND $table.isprivate < 1";
} }
...@@ -644,7 +644,9 @@ sub init { ...@@ -644,7 +644,9 @@ sub init {
} }
my $table = "longdescs_$chartseq"; my $table = "longdescs_$chartseq";
my $extra = ""; my $extra = "";
if (Param("insidergroup") && !UserInGroup(Param("insidergroup"))) { if (Bugzilla->params->{"insidergroup"}
&& !UserInGroup(Bugzilla->params->{"insidergroup"}))
{
$extra = "AND $table.isprivate < 1"; $extra = "AND $table.isprivate < 1";
} }
push(@supptables, "LEFT JOIN longdescs AS $table " . push(@supptables, "LEFT JOIN longdescs AS $table " .
...@@ -662,7 +664,9 @@ sub init { ...@@ -662,7 +664,9 @@ sub init {
} }
my $table = "longdescs_$chartseq"; my $table = "longdescs_$chartseq";
my $extra = ""; my $extra = "";
if (Param("insidergroup") && !UserInGroup(Param("insidergroup"))) { if (Bugzilla->params->{"insidergroup"}
&& !UserInGroup(Bugzilla->params->{"insidergroup"}))
{
$extra = "AND $table.isprivate < 1"; $extra = "AND $table.isprivate < 1";
} }
if ($list) { if ($list) {
...@@ -683,7 +687,9 @@ sub init { ...@@ -683,7 +687,9 @@ sub init {
"^long_?desc," => sub { "^long_?desc," => sub {
my $table = "longdescs_$chartid"; my $table = "longdescs_$chartid";
my $extra = ""; my $extra = "";
if (Param("insidergroup") && !UserInGroup(Param("insidergroup"))) { if (Bugzilla->params->{"insidergroup"}
&& !UserInGroup(Bugzilla->params->{"insidergroup"}))
{
$extra = "AND $table.isprivate < 1"; $extra = "AND $table.isprivate < 1";
} }
push(@supptables, "INNER JOIN longdescs AS $table " . push(@supptables, "INNER JOIN longdescs AS $table " .
...@@ -790,7 +796,9 @@ sub init { ...@@ -790,7 +796,9 @@ sub init {
my $atable = "attachments_$chartid"; my $atable = "attachments_$chartid";
my $dtable = "attachdata_$chartid"; my $dtable = "attachdata_$chartid";
my $extra = ""; my $extra = "";
if (Param("insidergroup") && !UserInGroup(Param("insidergroup"))) { if (Bugzilla->params->{"insidergroup"}
&& !UserInGroup(Bugzilla->params->{"insidergroup"}))
{
$extra = "AND $atable.isprivate = 0"; $extra = "AND $atable.isprivate = 0";
} }
push(@supptables, "INNER JOIN attachments AS $atable " . push(@supptables, "INNER JOIN attachments AS $atable " .
...@@ -802,7 +810,9 @@ sub init { ...@@ -802,7 +810,9 @@ sub init {
"^attachments\..*," => sub { "^attachments\..*," => sub {
my $table = "attachments_$chartid"; my $table = "attachments_$chartid";
my $extra = ""; my $extra = "";
if (Param("insidergroup") && !UserInGroup(Param("insidergroup"))) { if (Bugzilla->params->{"insidergroup"}
&& !UserInGroup(Bugzilla->params->{"insidergroup"}))
{
$extra = "AND $table.isprivate = 0"; $extra = "AND $table.isprivate = 0";
} }
push(@supptables, "INNER JOIN attachments AS $table " . push(@supptables, "INNER JOIN attachments AS $table " .
...@@ -1422,7 +1432,7 @@ sub init { ...@@ -1422,7 +1432,7 @@ sub init {
$query .= " OR (bugs.reporter_accessible = 1 AND bugs.reporter = $userid) " . $query .= " OR (bugs.reporter_accessible = 1 AND bugs.reporter = $userid) " .
" OR (bugs.cclist_accessible = 1 AND cc.who IS NOT NULL) " . " OR (bugs.cclist_accessible = 1 AND cc.who IS NOT NULL) " .
" OR (bugs.assigned_to = $userid) "; " OR (bugs.assigned_to = $userid) ";
if (Param('useqacontact')) { if (Bugzilla->params->{'useqacontact'}) {
$query .= "OR (bugs.qa_contact = $userid) "; $query .= "OR (bugs.qa_contact = $userid) ";
} }
} }
......
...@@ -118,7 +118,7 @@ sub quicksearch { ...@@ -118,7 +118,7 @@ sub quicksearch {
if (index($searchstring, ',') < $[) { if (index($searchstring, ',') < $[) {
# Single bug number; shortcut to show_bug.cgi. # 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"); "show_bug.cgi?id=$searchstring");
exit; exit;
} }
...@@ -138,7 +138,7 @@ sub quicksearch { ...@@ -138,7 +138,7 @@ sub quicksearch {
WHERE alias = ?}, WHERE alias = ?},
undef, undef,
$1)) { $1)) {
print $cgi->redirect(-uri => Param('urlbase') . print $cgi->redirect(-uri => Bugzilla->params->{'urlbase'} .
"show_bug.cgi?id=$1"); "show_bug.cgi?id=$1");
exit; exit;
} }
...@@ -154,7 +154,8 @@ sub quicksearch { ...@@ -154,7 +154,8 @@ sub quicksearch {
$searchstring =~ s/\s+NOT\s+/ -/g; $searchstring =~ s/\s+NOT\s+/ -/g;
my @words = splitString($searchstring); 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 @openStates = BUG_STATE_OPEN;
my @closedStates; my @closedStates;
my (%states, %resolutions); my (%states, %resolutions);
...@@ -381,9 +382,9 @@ sub quicksearch { ...@@ -381,9 +382,9 @@ sub quicksearch {
if ($cgi->param('load')) { if ($cgi->param('load')) {
# Param 'load' asks us to display the query in the advanced search form. # Param 'load' asks us to display the query in the advanced search form.
print $cgi->redirect(-uri => Param('urlbase') . "query.cgi?" . print $cgi->redirect(-uri => Bugzilla->params->{'urlbase'}
"format=advanced&amp;" . . "query.cgi?format=advanced&amp;"
$modified_query_string); . $modified_query_string);
} }
# Otherwise, pass the modified query string to the caller. # Otherwise, pass the modified query string to the caller.
......
...@@ -113,7 +113,7 @@ sub getTemplateIncludePath { ...@@ -113,7 +113,7 @@ sub getTemplateIncludePath {
my $templatedir = bz_locations()->{'templatedir'}; my $templatedir = bz_locations()->{'templatedir'};
my $project = bz_locations()->{'project'}; my $project = bz_locations()->{'project'};
my $languages = trim(Param('languages')); my $languages = trim(Bugzilla->params->{'languages'});
if (not ($languages =~ /,/)) { if (not ($languages =~ /,/)) {
if ($project) { if ($project) {
$template_include_path = [ $template_include_path = [
...@@ -141,7 +141,7 @@ sub getTemplateIncludePath { ...@@ -141,7 +141,7 @@ sub getTemplateIncludePath {
push (@usedlanguages, @found); push (@usedlanguages, @found);
} }
} }
push(@usedlanguages, Param('defaultlanguage')); push(@usedlanguages, Bugzilla->params->{'defaultlanguage'});
if ($project) { if ($project) {
$template_include_path = [ $template_include_path = [
map(( map((
...@@ -277,7 +277,9 @@ sub quoteUrls { ...@@ -277,7 +277,9 @@ sub quoteUrls {
my $tmp; my $tmp;
# Provide tooltips for full bug links (Bug 74355) # 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 $text =~ s~\b(${urlbase_re}\Qshow_bug.cgi?id=\E([0-9]+))\b
~($things[$count++] = get_bug_link($3, $1)) && ~($things[$count++] = get_bug_link($3, $1)) &&
("\0\0" . ($count-1) . "\0\0") ("\0\0" . ($count-1) . "\0\0")
...@@ -697,7 +699,7 @@ sub create { ...@@ -697,7 +699,7 @@ sub create {
my ($var) = Template::Filters::html_filter(@_); my ($var) = Template::Filters::html_filter(@_);
# Obscure '@'. # Obscure '@'.
$var =~ s/\@/\&#64;/g; $var =~ s/\@/\&#64;/g;
if (Param('utf8')) { if (Bugzilla->params->{'utf8'}) {
# Remove the following characters because they're # Remove the following characters because they're
# influencing BiDi: # influencing BiDi:
# -------------------------------------------------------- # --------------------------------------------------------
......
...@@ -107,7 +107,7 @@ sub process { ...@@ -107,7 +107,7 @@ sub process {
# get a list of languages we accept so we can find the hook # get a list of languages we accept so we can find the hook
# that corresponds to our desired languages: # that corresponds to our desired languages:
sub getLanguages() { sub getLanguages() {
my $languages = trim(Param('languages')); my $languages = trim(Bugzilla->params->{'languages'});
if (not ($languages =~ /,/)) { # only one language if (not ($languages =~ /,/)) { # only one language
return $languages; return $languages;
} }
......
...@@ -50,6 +50,7 @@ my $maxtokenage = 3; ...@@ -50,6 +50,7 @@ my $maxtokenage = 3;
sub IssueEmailChangeToken { sub IssueEmailChangeToken {
my ($userid, $old_email, $new_email) = @_; 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 ($token, $token_ts) = _create_token($userid, 'emailold', $old_email . ":" . $new_email);
...@@ -60,14 +61,14 @@ sub IssueEmailChangeToken { ...@@ -60,14 +61,14 @@ sub IssueEmailChangeToken {
my $template = Bugzilla->template; my $template = Bugzilla->template;
my $vars = {}; my $vars = {};
$vars->{'oldemailaddress'} = $old_email . Param('emailsuffix'); $vars->{'oldemailaddress'} = $old_email . $email_suffix;
$vars->{'newemailaddress'} = $new_email . Param('emailsuffix'); $vars->{'newemailaddress'} = $new_email . $email_suffix;
$vars->{'max_token_age'} = $maxtokenage; $vars->{'max_token_age'} = $maxtokenage;
$vars->{'token_ts'} = $token_ts; $vars->{'token_ts'} = $token_ts;
$vars->{'token'} = $token; $vars->{'token'} = $token;
$vars->{'emailaddress'} = $old_email . Param('emailsuffix'); $vars->{'emailaddress'} = $old_email . $email_suffix;
my $message; my $message;
$template->process("account/email/change-old.txt.tmpl", $vars, \$message) $template->process("account/email/change-old.txt.tmpl", $vars, \$message)
...@@ -76,7 +77,7 @@ sub IssueEmailChangeToken { ...@@ -76,7 +77,7 @@ sub IssueEmailChangeToken {
MessageToMTA($message); MessageToMTA($message);
$vars->{'token'} = $newtoken; $vars->{'token'} = $newtoken;
$vars->{'emailaddress'} = $new_email . Param('emailsuffix'); $vars->{'emailaddress'} = $new_email . $email_suffix;
$message = ""; $message = "";
$template->process("account/email/change-new.txt.tmpl", $vars, \$message) $template->process("account/email/change-new.txt.tmpl", $vars, \$message)
...@@ -112,7 +113,7 @@ sub IssuePasswordToken { ...@@ -112,7 +113,7 @@ sub IssuePasswordToken {
# Mail the user the token along with instructions for using it. # Mail the user the token along with instructions for using it.
$vars->{'token'} = $token; $vars->{'token'} = $token;
$vars->{'emailaddress'} = $loginname . Param('emailsuffix'); $vars->{'emailaddress'} = $loginname . Bugzilla->params->{'emailsuffix'};
$vars->{'max_token_age'} = $maxtokenage; $vars->{'max_token_age'} = $maxtokenage;
$vars->{'token_ts'} = $token_ts; $vars->{'token_ts'} = $token_ts;
...@@ -191,11 +192,11 @@ sub Cancel { ...@@ -191,11 +192,11 @@ sub Cancel {
undef, $token); undef, $token);
# Get the email address of the Bugzilla maintainer. # Get the email address of the Bugzilla maintainer.
my $maintainer = Param('maintainer'); my $maintainer = Bugzilla->params->{'maintainer'};
my $template = Bugzilla->template; my $template = Bugzilla->template;
$vars->{'emailaddress'} = $loginname . Param('emailsuffix'); $vars->{'emailaddress'} = $loginname . Bugzilla->params->{'emailsuffix'};
$vars->{'maintainer'} = $maintainer; $vars->{'maintainer'} = $maintainer;
$vars->{'remoteaddress'} = $::ENV{'REMOTE_ADDR'}; $vars->{'remoteaddress'} = $::ENV{'REMOTE_ADDR'};
$vars->{'token'} = $token; $vars->{'token'} = $token;
......
...@@ -152,7 +152,7 @@ sub _create { ...@@ -152,7 +152,7 @@ sub _create {
# Accessors for user attributes # Accessors for user attributes
sub id { $_[0]->{id}; } sub id { $_[0]->{id}; }
sub login { $_[0]->{login}; } sub login { $_[0]->{login}; }
sub email { $_[0]->{login} . Param('emailsuffix'); } sub email { $_[0]->{login} . Bugzilla->params->{'emailsuffix'}; }
sub name { $_[0]->{name}; } sub name { $_[0]->{name}; }
sub disabledtext { $_[0]->{'disabledtext'}; } sub disabledtext { $_[0]->{'disabledtext'}; }
sub is_disabled { $_[0]->disabledtext ? 1 : 0; } sub is_disabled { $_[0]->disabledtext ? 1 : 0; }
...@@ -365,7 +365,9 @@ sub bless_groups { ...@@ -365,7 +365,9 @@ sub bless_groups {
} }
# If visibilitygroups are used, restrict the set of groups. # 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. # Users need to see a group in order to bless it.
my $visibleGroups = join(', ', @{$self->visible_groups_direct()}) my $visibleGroups = join(', ', @{$self->visible_groups_direct()})
|| return $self->{'bless_groups'} = []; || return $self->{'bless_groups'} = [];
...@@ -393,7 +395,7 @@ sub can_see_user { ...@@ -393,7 +395,7 @@ sub can_see_user {
my ($self, $otherUser) = @_; my ($self, $otherUser) = @_;
my $query; my $query;
if (Param('usevisibilitygroups')) { if (Bugzilla->params->{'usevisibilitygroups'}) {
# If the user can see no groups, then no users are visible either. # If the user can see no groups, then no users are visible either.
my $visibleGroups = $self->visible_groups_as_string() || return 0; my $visibleGroups = $self->visible_groups_as_string() || return 0;
$query = qq{SELECT COUNT(DISTINCT userid) $query = qq{SELECT COUNT(DISTINCT userid)
...@@ -466,7 +468,8 @@ sub can_see_bug { ...@@ -466,7 +468,8 @@ sub can_see_bug {
$self->{sthCanSeeBug} = $sth; $self->{sthCanSeeBug} = $sth;
return ($ready return ($ready
&& ((($reporter == $userid) && $reporter_access) && ((($reporter == $userid) && $reporter_access)
|| (Param('useqacontact') && $qacontact && ($qacontact == $userid)) || (Bugzilla->params->{'useqacontact'}
&& $qacontact && ($qacontact == $userid))
|| ($owner == $userid) || ($owner == $userid)
|| ($isoncclist && $cclist_access) || ($isoncclist && $cclist_access)
|| (!$missinggroup))); || (!$missinggroup)));
...@@ -493,7 +496,7 @@ sub get_selectable_products { ...@@ -493,7 +496,7 @@ sub get_selectable_products {
"FROM products " . "FROM products " .
"LEFT JOIN group_control_map " . "LEFT JOIN group_control_map " .
"ON group_control_map.product_id = products.id "; "ON group_control_map.product_id = products.id ";
if (Param('useentrygroupdefault')) { if (Bugzilla->params->{'useentrygroupdefault'}) {
$query .= "AND group_control_map.entry != 0 "; $query .= "AND group_control_map.entry != 0 ";
} else { } else {
$query .= "AND group_control_map.membercontrol = " . $query .= "AND group_control_map.membercontrol = " .
...@@ -503,7 +506,7 @@ sub get_selectable_products { ...@@ -503,7 +506,7 @@ sub get_selectable_products {
$self->groups_as_string . ") " . $self->groups_as_string . ") " .
"WHERE group_id IS NULL "; "WHERE group_id IS NULL ";
if (Param('useclassification') && $classification_id) { if (Bugzilla->params->{'useclassification'} && $classification_id) {
$query .= "AND classification_id = ? "; $query .= "AND classification_id = ? ";
detaint_natural($classification_id); detaint_natural($classification_id);
push(@params, $classification_id); push(@params, $classification_id);
...@@ -783,20 +786,22 @@ sub match { ...@@ -783,20 +786,22 @@ sub match {
# first try wildcards # first try wildcards
my $wildstr = $str; my $wildstr = $str;
if ($wildstr =~ s/\*/\%/g && # don't do wildcards if no '*' in the string if ($wildstr =~ s/\*/\%/g # don't do wildcards if no '*' in the string
Param('usermatchmode') ne 'off') { # or if we only want exact matches # or if we only want exact matches
&& Bugzilla->params->{'usermatchmode'} ne 'off')
{
# Build the query. # Build the query.
trick_taint($wildstr); trick_taint($wildstr);
my $query = "SELECT DISTINCT login_name FROM profiles "; my $query = "SELECT DISTINCT login_name FROM profiles ";
if (Param('usevisibilitygroups')) { if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= "INNER JOIN user_group_map $query .= "INNER JOIN user_group_map
ON user_group_map.user_id = profiles.userid "; ON user_group_map.user_id = profiles.userid ";
} }
$query .= "WHERE (" $query .= "WHERE ("
. $dbh->sql_istrcmp('login_name', '?', "LIKE") . " OR " . . $dbh->sql_istrcmp('login_name', '?', "LIKE") . " OR " .
$dbh->sql_istrcmp('realname', '?', "LIKE") . ") "; $dbh->sql_istrcmp('realname', '?', "LIKE") . ") ";
if (Param('usevisibilitygroups')) { if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= "AND isbless = 0 " . $query .= "AND isbless = 0 " .
"AND group_id IN(" . "AND group_id IN(" .
join(', ', (-1, @{$user->visible_groups_inherited})) . ") "; join(', ', (-1, @{$user->visible_groups_inherited})) . ") ";
...@@ -824,21 +829,21 @@ sub match { ...@@ -824,21 +829,21 @@ sub match {
# then try substring search # then try substring search
if ((scalar(@users) == 0) if ((scalar(@users) == 0)
&& (Param('usermatchmode') eq 'search') && (Bugzilla->params->{'usermatchmode'} eq 'search')
&& (length($str) >= 3)) && (length($str) >= 3))
{ {
$str = lc($str); $str = lc($str);
trick_taint($str); trick_taint($str);
my $query = "SELECT DISTINCT login_name FROM profiles "; my $query = "SELECT DISTINCT login_name FROM profiles ";
if (Param('usevisibilitygroups')) { if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= "INNER JOIN user_group_map $query .= "INNER JOIN user_group_map
ON user_group_map.user_id = profiles.userid "; ON user_group_map.user_id = profiles.userid ";
} }
$query .= " WHERE (" . $query .= " WHERE (" .
$dbh->sql_position('?', 'LOWER(login_name)') . " > 0" . " OR " . $dbh->sql_position('?', 'LOWER(login_name)') . " > 0" . " OR " .
$dbh->sql_position('?', 'LOWER(realname)') . " > 0) "; $dbh->sql_position('?', 'LOWER(realname)') . " > 0) ";
if (Param('usevisibilitygroups')) { if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= " AND isbless = 0" . $query .= " AND isbless = 0" .
" AND group_id IN(" . " AND group_id IN(" .
join(', ', (-1, @{$user->visible_groups_inherited})) . ") "; join(', ', (-1, @{$user->visible_groups_inherited})) . ") ";
...@@ -907,6 +912,8 @@ sub match_field { ...@@ -907,6 +912,8 @@ sub match_field {
my $need_confirm = 0; # whether to display confirmation screen my $need_confirm = 0; # whether to display confirmation screen
my $match_multiple = 0; # whether we ever matched more than one user my $match_multiple = 0; # whether we ever matched more than one user
my $params = Bugzilla->params;
# prepare default form values # prepare default form values
# What does a "--do_not_change--" field look like (if any)? # What does a "--do_not_change--" field look like (if any)?
...@@ -1007,8 +1014,8 @@ sub match_field { ...@@ -1007,8 +1014,8 @@ sub match_field {
} }
my $limit = 0; my $limit = 0;
if (Param('maxusermatches')) { if ($params->{'maxusermatches'}) {
$limit = Param('maxusermatches') + 1; $limit = $params->{'maxusermatches'} + 1;
} }
for my $query (@queries) { for my $query (@queries) {
...@@ -1039,16 +1046,16 @@ sub match_field { ...@@ -1039,16 +1046,16 @@ sub match_field {
$cgi->append(-name=>$field, $cgi->append(-name=>$field,
-values=>[@{$users}[0]->{'login'}]); -values=>[@{$users}[0]->{'login'}]);
$need_confirm = 1 if Param('confirmuniqueusermatch'); $need_confirm = 1 if $params->{'confirmuniqueusermatch'};
} }
elsif ((scalar(@{$users}) > 1) elsif ((scalar(@{$users}) > 1)
&& (Param('maxusermatches') != 1)) { && ($params->{'maxusermatches'} != 1)) {
$need_confirm = 1; $need_confirm = 1;
$match_multiple = 1; $match_multiple = 1;
if ((Param('maxusermatches')) if (($params->{'maxusermatches'})
&& (scalar(@{$users}) > Param('maxusermatches'))) && (scalar(@{$users}) > $params->{'maxusermatches'}))
{ {
$matches->{$field}->{$query}->{'status'} = 'trunc'; $matches->{$field}->{$query}->{'status'} = 'trunc';
pop @{$users}; # take the last one out pop @{$users}; # take the last one out
...@@ -1251,7 +1258,7 @@ sub is_mover { ...@@ -1251,7 +1258,7 @@ sub is_mover {
my $self = shift; my $self = shift;
if (!defined $self->{'is_mover'}) { 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 $self->{'is_mover'} = ($self->id
&& lsearch(\@movers, $self->login) != -1); && lsearch(\@movers, $self->login) != -1);
} }
...@@ -1265,13 +1272,13 @@ sub get_userlist { ...@@ -1265,13 +1272,13 @@ sub get_userlist {
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $query = "SELECT DISTINCT login_name, realname,"; my $query = "SELECT DISTINCT login_name, realname,";
if (Param('usevisibilitygroups')) { if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= " COUNT(group_id) "; $query .= " COUNT(group_id) ";
} else { } else {
$query .= " 1 "; $query .= " 1 ";
} }
$query .= "FROM profiles "; $query .= "FROM profiles ";
if (Param('usevisibilitygroups')) { if (Bugzilla->params->{'usevisibilitygroups'}) {
$query .= "LEFT JOIN user_group_map " . $query .= "LEFT JOIN user_group_map " .
"ON user_group_map.user_id = userid AND isbless = 0 " . "ON user_group_map.user_id = userid AND isbless = 0 " .
"AND group_id IN(" . "AND group_id IN(" .
......
...@@ -165,8 +165,8 @@ sub validateID ...@@ -165,8 +165,8 @@ sub validateID
# Make sure the user is authorized to access this attachment's bug. # Make sure the user is authorized to access this attachment's bug.
ValidateBugID($bugid); ValidateBugID($bugid);
if ($isprivate && Param("insidergroup")) { if ($isprivate && Bugzilla->params->{"insidergroup"}) {
UserInGroup(Param("insidergroup")) UserInGroup(Bugzilla->params->{"insidergroup"})
|| ThrowUserError("auth_failure", {action => "access", || ThrowUserError("auth_failure", {action => "access",
object => "attachment"}); object => "attachment"});
} }
...@@ -487,8 +487,9 @@ sub get_unified_diff ...@@ -487,8 +487,9 @@ sub get_unified_diff
my $last_reader = $reader; my $last_reader = $reader;
# fixes patch root (makes canonical if possible) # fixes patch root (makes canonical if possible)
if (Param('cvsroot')) { if (Bugzilla->params->{'cvsroot'}) {
my $fix_patch_root = new PatchReader::FixPatchRoot(Param('cvsroot')); my $fix_patch_root =
new PatchReader::FixPatchRoot(Bugzilla->params->{'cvsroot'});
$last_reader->sends_data_to($fix_patch_root); $last_reader->sends_data_to($fix_patch_root);
$last_reader = $fix_patch_root; $last_reader = $fix_patch_root;
} }
...@@ -548,20 +549,21 @@ sub setup_patch_readers { ...@@ -548,20 +549,21 @@ sub setup_patch_readers {
my $reader = new PatchReader::Raw; my $reader = new PatchReader::Raw;
my $last_reader = $reader; my $last_reader = $reader;
# Fix the patch root if we have a cvs root # Fix the patch root if we have a cvs root
if (Param('cvsroot')) if (Bugzilla->params->{'cvsroot'})
{ {
require PatchReader::FixPatchRoot; 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->sends_data_to->diff_root($diff_root) if defined($diff_root);
$last_reader = $last_reader->sends_data_to; $last_reader = $last_reader->sends_data_to;
} }
# Add in cvs context if we have the necessary info to do it # 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; require PatchReader::AddCVSContext;
$last_reader->sends_data_to( $last_reader->sends_data_to(
new PatchReader::AddCVSContext($context, new PatchReader::AddCVSContext($context,
Param('cvsroot_get'))); Bugzilla->params->{'cvsroot_get'}));
$last_reader = $last_reader->sends_data_to; $last_reader = $last_reader->sends_data_to;
} }
return ($reader, $last_reader); return ($reader, $last_reader);
...@@ -581,7 +583,8 @@ sub setup_template_patch_reader ...@@ -581,7 +583,8 @@ sub setup_template_patch_reader
} }
$vars->{collapsed} = $cgi->param('collapsed'); $vars->{collapsed} = $cgi->param('collapsed');
$vars->{context} = $context; $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 everything out
print $cgi->header(-type => 'text/html', print $cgi->header(-type => 'text/html',
...@@ -591,9 +594,9 @@ sub setup_template_patch_reader ...@@ -591,9 +594,9 @@ sub setup_template_patch_reader
"attachment/diff-file.$format.tmpl", "attachment/diff-file.$format.tmpl",
"attachment/diff-footer.$format.tmpl", "attachment/diff-footer.$format.tmpl",
{ %{$vars}, { %{$vars},
bonsai_url => Param('bonsai_url'), bonsai_url => Bugzilla->params->{'bonsai_url'},
lxr_url => Param('lxr_url'), lxr_url => Bugzilla->params->{'lxr_url'},
lxr_root => Param('lxr_root'), lxr_root => Bugzilla->params->{'lxr_root'},
})); }));
} }
...@@ -677,7 +680,9 @@ sub viewall ...@@ -677,7 +680,9 @@ sub viewall
my $privacy = ""; my $privacy = "";
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
if (Param("insidergroup") && !(UserInGroup(Param("insidergroup")))) { if ( Bugzilla->params->{"insidergroup"}
&& !UserInGroup(Bugzilla->params->{"insidergroup"}) )
{
$privacy = "AND isprivate < 1 "; $privacy = "AND isprivate < 1 ";
} }
my $attachments = $dbh->selectall_arrayref( my $attachments = $dbh->selectall_arrayref(
...@@ -1099,7 +1104,7 @@ sub delete_attachment { ...@@ -1099,7 +1104,7 @@ sub delete_attachment {
action => 'delete', action => 'delete',
object => 'attachment'}); object => 'attachment'});
Param('allow_attachment_deletion') Bugzilla->params->{'allow_attachment_deletion'}
|| ThrowUserError('attachment_deletion_disabled'); || ThrowUserError('attachment_deletion_disabled');
# Make sure the administrator is allowed to edit this attachment. # Make sure the administrator is allowed to edit this attachment.
......
...@@ -632,7 +632,7 @@ if (trim($votes) && !grep($_ eq 'votes', @displaycolumns)) { ...@@ -632,7 +632,7 @@ if (trim($votes) && !grep($_ eq 'votes', @displaycolumns)) {
# Remove the timetracking columns if they are not a part of the group # 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) # (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 'estimated_time', @displaycolumns);
@displaycolumns = grep($_ ne 'remaining_time', @displaycolumns); @displaycolumns = grep($_ ne 'remaining_time', @displaycolumns);
@displaycolumns = grep($_ ne 'actual_time', @displaycolumns); @displaycolumns = grep($_ ne 'actual_time', @displaycolumns);
...@@ -659,7 +659,7 @@ my @selectcolumns = ("bug_id", "bug_severity", "priority", "bug_status", ...@@ -659,7 +659,7 @@ my @selectcolumns = ("bug_id", "bug_severity", "priority", "bug_status",
"resolution"); "resolution");
# if using classification, we also need to look in product.classification_id # if using classification, we also need to look in product.classification_id
if (Param("useclassification")) { if (Bugzilla->params->{"useclassification"}) {
push (@selectcolumns,"product"); push (@selectcolumns,"product");
} }
...@@ -1020,7 +1020,7 @@ $vars->{'caneditbugs'} = UserInGroup('editbugs'); ...@@ -1020,7 +1020,7 @@ $vars->{'caneditbugs'} = UserInGroup('editbugs');
my @bugowners = keys %$bugowners; my @bugowners = keys %$bugowners;
if (scalar(@bugowners) > 1 && UserInGroup('editbugs')) { if (scalar(@bugowners) > 1 && UserInGroup('editbugs')) {
my $suffix = Param('emailsuffix'); my $suffix = Bugzilla->params->{'emailsuffix'};
map(s/$/$suffix/, @bugowners) if $suffix; map(s/$/$suffix/, @bugowners) if $suffix;
my $bugowners = join(",", @bugowners); my $bugowners = join(",", @bugowners);
$vars->{'bugowners'} = $bugowners; $vars->{'bugowners'} = $bugowners;
...@@ -1063,7 +1063,7 @@ if ($dotweak) { ...@@ -1063,7 +1063,7 @@ if ($dotweak) {
$vars->{'versions'} = [map($_->name ,@{$product->versions})]; $vars->{'versions'} = [map($_->name ,@{$product->versions})];
$vars->{'components'} = [map($_->name, @{$product->components})]; $vars->{'components'} = [map($_->name, @{$product->components})];
$vars->{'targetmilestones'} = [map($_->name, @{$product->milestones})] $vars->{'targetmilestones'} = [map($_->name, @{$product->milestones})]
if Param('usetargetmilestone'); if Bugzilla->params->{'usetargetmilestone'};
} }
} }
...@@ -1118,7 +1118,7 @@ if ($serverpush) { ...@@ -1118,7 +1118,7 @@ if ($serverpush) {
# close the "please wait" page, then open the buglist page # close the "please wait" page, then open the buglist page
print $cgi->multipart_end(); print $cgi->multipart_end();
my @extra; my @extra;
push @extra, (-charset => "utf8") if Param("utf8"); push @extra, (-charset => "utf8") if Bugzilla->params->{"utf8"};
print $cgi->multipart_start(-type => $contenttype, print $cgi->multipart_start(-type => $contenttype,
-content_disposition => $disposition, -content_disposition => $disposition,
@extra); @extra);
......
...@@ -90,8 +90,8 @@ if ($action eq "search") { ...@@ -90,8 +90,8 @@ if ($action eq "search") {
my $user = Bugzilla->login(LOGIN_REQUIRED); my $user = Bugzilla->login(LOGIN_REQUIRED);
UserInGroup(Param("chartgroup")) UserInGroup(Bugzilla->params->{"chartgroup"})
|| ThrowUserError("auth_failure", {group => Param("chartgroup"), || ThrowUserError("auth_failure", {group => Bugzilla->params->{"chartgroup"},
action => "use", action => "use",
object => "charts"}); object => "charts"});
......
...@@ -1389,7 +1389,7 @@ if (@oldparams) { ...@@ -1389,7 +1389,7 @@ if (@oldparams) {
# if running on Windows and no third party sendmail wrapper # if running on Windows and no third party sendmail wrapper
# is available # is available
if ($^O =~ /MSWin32/i if ($^O =~ /MSWin32/i
&& Param('mail_delivery_method') eq 'sendmail' && Bugzilla->params->{'mail_delivery_method'} eq 'sendmail'
&& !-e SENDMAIL_EXE) && !-e SENDMAIL_EXE)
{ {
print "\nBugzilla requires an SMTP server to function on Windows.\n" . print "\nBugzilla requires an SMTP server to function on Windows.\n" .
...@@ -1670,7 +1670,7 @@ import Bugzilla::Bug qw(is_open_state); ...@@ -1670,7 +1670,7 @@ import Bugzilla::Bug qw(is_open_state);
# Check for LDAP # 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') { if ($verifymethod eq 'LDAP') {
my $netLDAP = have_vers("Net::LDAP", 0); my $netLDAP = have_vers("Net::LDAP", 0);
if (!$netLDAP && !$silent) { if (!$netLDAP && !$silent) {
...@@ -1688,12 +1688,12 @@ for my $verifymethod (split /,\s*/, Param('user_verify_class')) { ...@@ -1688,12 +1688,12 @@ for my $verifymethod (split /,\s*/, Param('user_verify_class')) {
# and that the generated images are accessible. # 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; printf("Checking for %15s %-9s ", "GraphViz", "(any)") unless $silent;
if(-x Param('webdotbase')) { if(-x Bugzilla->params->{'webdotbase'}) {
print "ok: found\n" unless $silent; print "ok: found\n" unless $silent;
} else { } 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 # Check .htaccess allows access to generated images
...@@ -3413,7 +3413,7 @@ if ($dbh->bz_table_info("flagtypes")) { ...@@ -3413,7 +3413,7 @@ if ($dbh->bz_table_info("flagtypes")) {
# #
# If group_control_map is empty, backward-compatibility # If group_control_map is empty, backward-compatibility
# usebuggroups-equivalent records should be created. # 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 = $dbh->prepare("SELECT COUNT(*) FROM group_control_map");
$sth->execute(); $sth->execute();
my ($mapcnt) = $sth->fetchrow_array(); my ($mapcnt) = $sth->fetchrow_array();
...@@ -4088,7 +4088,7 @@ if (!exists $dbh->bz_column_info('whine_queries', 'title')->{DEFAULT}) { ...@@ -4088,7 +4088,7 @@ if (!exists $dbh->bz_column_info('whine_queries', 'title')->{DEFAULT}) {
undef, "Other", "other"); undef, "Other", "other");
$dbh->do('UPDATE bugs SET op_sys = ? WHERE op_sys = ?', $dbh->do('UPDATE bugs SET op_sys = ? WHERE op_sys = ?',
undef, "Other", "other"); 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 # We can't actually fix the param here, because WriteParams() will
# make $datadir/params unwriteable to the webservergroup. # make $datadir/params unwriteable to the webservergroup.
# It's too much of an ugly hack to copy the permission-fixing code # It's too much of an ugly hack to copy the permission-fixing code
...@@ -4608,9 +4608,9 @@ if ($sth->rows == 0) { ...@@ -4608,9 +4608,9 @@ if ($sth->rows == 0) {
if (-e "$datadir/params") { if (-e "$datadir/params") {
require "$datadir/params"; # if they have a params file, use that require "$datadir/params"; # if they have a params file, use that
} }
if (Param('emailregexp')) { if (Bugzilla->params->{'emailregexp'}) {
$mailcheckexp = Param('emailregexp'); $mailcheckexp = Bugzilla->params->{'emailregexp'};
$mailcheck = Param('emailregexpdesc'); $mailcheck = Bugzilla->params->{'emailregexpdesc'};
} else { } else {
$mailcheckexp = '^[\\w\\.\\+\\-=]+@[\\w\\.\\-]+\\.[\\w\\-]+$'; $mailcheckexp = '^[\\w\\.\\+\\-=]+@[\\w\\.\\-]+\\.[\\w\\-]+$';
$mailcheck = 'A legal address must contain exactly one \'@\', $mailcheck = 'A legal address must contain exactly one \'@\',
...@@ -4805,7 +4805,7 @@ foreach my $item (@params) { ...@@ -4805,7 +4805,7 @@ foreach my $item (@params) {
last; 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" . print "Now that you have installed Bugzilla, you should visit the \n" .
"'Parameters' page (linked in the footer of the Administrator \n" . "'Parameters' page (linked in the footer of the Administrator \n" .
"account) to ensure it is set up as you wish - this includes \n" . "account) to ensure it is set up as you wish - this includes \n" .
......
...@@ -45,33 +45,33 @@ my @masterlist = ("opendate", "changeddate", "bug_severity", "priority", ...@@ -45,33 +45,33 @@ my @masterlist = ("opendate", "changeddate", "bug_severity", "priority",
"reporter", "reporter_realname", "bug_status", "reporter", "reporter_realname", "bug_status",
"resolution"); "resolution");
if (Param("useclassification")) { if (Bugzilla->params->{"useclassification"}) {
push(@masterlist, "classification"); push(@masterlist, "classification");
} }
push(@masterlist, ("product", "component", "version", "op_sys")); push(@masterlist, ("product", "component", "version", "op_sys"));
if (Param("usevotes")) { if (Bugzilla->params->{"usevotes"}) {
push (@masterlist, "votes"); push (@masterlist, "votes");
} }
if (Param("usebugaliases")) { if (Bugzilla->params->{"usebugaliases"}) {
unshift(@masterlist, "alias"); unshift(@masterlist, "alias");
} }
if (Param("usetargetmilestone")) { if (Bugzilla->params->{"usetargetmilestone"}) {
push(@masterlist, "target_milestone"); push(@masterlist, "target_milestone");
} }
if (Param("useqacontact")) { if (Bugzilla->params->{"useqacontact"}) {
push(@masterlist, "qa_contact"); push(@masterlist, "qa_contact");
push(@masterlist, "qa_contact_realname"); push(@masterlist, "qa_contact_realname");
} }
if (Param("usestatuswhiteboard")) { if (Bugzilla->params->{"usestatuswhiteboard"}) {
push(@masterlist, "status_whiteboard"); push(@masterlist, "status_whiteboard");
} }
if (Bugzilla::Keyword::keyword_count()) { if (Bugzilla::Keyword::keyword_count()) {
push(@masterlist, "keywords"); push(@masterlist, "keywords");
} }
if (UserInGroup(Param("timetrackinggroup"))) { if (UserInGroup(Bugzilla->params->{"timetrackinggroup"})) {
push(@masterlist, ("estimated_time", "remaining_time", "actual_time", push(@masterlist, ("estimated_time", "remaining_time", "actual_time",
"percentage_complete", "deadline")); "percentage_complete", "deadline"));
} }
...@@ -96,7 +96,7 @@ if (defined $cgi->param('rememberedquery')) { ...@@ -96,7 +96,7 @@ if (defined $cgi->param('rememberedquery')) {
} }
} }
my $list = join(" ", @collist); my $list = join(" ", @collist);
my $urlbase = Param("urlbase"); my $urlbase = Bugzilla->params->{"urlbase"};
if ($list) { if ($list) {
$cgi->send_cookie(-name => 'COLUMNLIST', $cgi->send_cookie(-name => 'COLUMNLIST',
......
...@@ -42,7 +42,7 @@ my $user = Bugzilla->login(LOGIN_OPTIONAL); ...@@ -42,7 +42,7 @@ my $user = Bugzilla->login(LOGIN_OPTIONAL);
# If the 'requirelogin' parameter is on and the user is not # If the 'requirelogin' parameter is on and the user is not
# authenticated, return empty fields. # authenticated, return empty fields.
if (Param('requirelogin') && !$user->id) { if (Bugzilla->params->{'requirelogin'} && !$user->id) {
display_data(); display_data();
} }
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
# #
# You need to work with bug_email.pl the MIME::Parser installed. # 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) # 02/12/2000 (SML)
...@@ -274,12 +274,12 @@ sub CheckPriority ...@@ -274,12 +274,12 @@ sub CheckPriority
my $Text = "You sent wrong priority-setting, valid values are:" . my $Text = "You sent wrong priority-setting, valid values are:" .
join( "\n\t", @$all_prios ) . "\n\n"; join( "\n\t", @$all_prios ) . "\n\n";
$Text .= "* The priority is set to the default value ". $Text .= "* The priority is set to the default value ".
Param('defaultpriority') . "\n"; Bugzilla->params->{'defaultpriority'} . "\n";
BugMailError( 0, $Text ); BugMailError( 0, $Text );
# set default value from param-file # set default value from param-file
$Control{'priority'} = Param( 'defaultpriority' ); $Control{'priority'} = Bugzilla->params->{ 'defaultpriority' };
} else { } else {
# Nothing to do # Nothing to do
} }
...@@ -767,7 +767,7 @@ if (! CheckPermissions("CreateBugs", $SenderShort ) ) { ...@@ -767,7 +767,7 @@ if (! CheckPermissions("CreateBugs", $SenderShort ) ) {
} }
# Set QA # Set QA
if (Param("useqacontact")) { if (Bugzilla->params->{"useqacontact"}) {
if (defined($Control{'qa_contact'}) if (defined($Control{'qa_contact'})
&& $Control{'qa_contact'} !~ /^\s*$/ ) { && $Control{'qa_contact'} !~ /^\s*$/ ) {
$Control{'qa_contact'} = DBname_to_id($Control{'qa_contact'}); $Control{'qa_contact'} = DBname_to_id($Control{'qa_contact'});
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Nick Barnes, Ravenbrook Limited, 2004-04-01. # 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 # 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. # bugmail for a bug which has been changed directly in the database.
...@@ -54,7 +54,7 @@ if (!$id) { ...@@ -54,7 +54,7 @@ if (!$id) {
} }
# Validate the changer address. # Validate the changer address.
my $match = Param('emailregexp'); my $match = Bugzilla->params->{'emailregexp'};
if ($changer !~ /$match/) { if ($changer !~ /$match/) {
print STDERR "Changer \"$changer\" doesn't match email regular expression.\n"; print STDERR "Changer \"$changer\" doesn't match email regular expression.\n";
usage(); usage();
......
...@@ -92,7 +92,7 @@ foreach my $login_name (keys %$bugzilla_users) { ...@@ -92,7 +92,7 @@ foreach my $login_name (keys %$bugzilla_users) {
### ###
# Get current LDAP users # Get current LDAP users
### ###
my $LDAPserver = Param("LDAPserver"); my $LDAPserver = Bugzilla->params->{"LDAPserver"};
if ($LDAPserver eq "") { if ($LDAPserver eq "") {
print "No LDAP server defined in bugzilla preferences.\n"; print "No LDAP server defined in bugzilla preferences.\n";
exit; exit;
...@@ -108,8 +108,8 @@ if(!$LDAPconn) { ...@@ -108,8 +108,8 @@ if(!$LDAPconn) {
exit; exit;
} }
my $mesg; my $mesg;
if (Param("LDAPbinddn")) { if (Bugzilla->params->{"LDAPbinddn"}) {
my ($LDAPbinddn,$LDAPbindpass) = split(":",Param("LDAPbinddn")); my ($LDAPbinddn,$LDAPbindpass) = split(":",Bugzilla->params->{"LDAPbinddn"});
$mesg = $LDAPconn->bind($LDAPbinddn, password => $LDAPbindpass); $mesg = $LDAPconn->bind($LDAPbinddn, password => $LDAPbindpass);
} }
else { else {
...@@ -121,9 +121,9 @@ if($mesg->code) { ...@@ -121,9 +121,9 @@ if($mesg->code) {
} }
# We've got our anonymous bind; let's look up the users. # 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", scope => "sub",
filter => '(&(' . Param("LDAPuidattribute") . "=*)" . Param("LDAPfilter") . ')', filter => '(&(' . Bugzilla->params->{"LDAPuidattribute"} . "=*)" . Bugzilla->params->{"LDAPfilter"} . ')',
); );
...@@ -136,7 +136,7 @@ my $val = $mesg->as_struct; ...@@ -136,7 +136,7 @@ my $val = $mesg->as_struct;
while( my ($key, $value) = each(%$val) ) { while( my ($key, $value) = each(%$val) ) {
my $login_name = @$value{Param("LDAPmailattribute")}; my $login_name = @$value{Bugzilla->params->{"LDAPmailattribute"}};
my $realname = @$value{"cn"}; my $realname = @$value{"cn"};
# no mail entered? go to next # no mail entered? go to next
...@@ -147,7 +147,7 @@ while( my ($key, $value) = each(%$val) ) { ...@@ -147,7 +147,7 @@ while( my ($key, $value) = each(%$val) ) {
# no cn entered? use uid instead # no cn entered? use uid instead
if(! defined $realname) { if(! defined $realname) {
$realname = @$value{Param("LDAPuidattribute")}; $realname = @$value{Bugzilla->params->{"LDAPuidattribute"}};
} }
my $login = shift @$login_name; my $login = shift @$login_name;
......
...@@ -53,7 +53,7 @@ unless (Bugzilla->user->authorizer->user_can_create_account) { ...@@ -53,7 +53,7 @@ unless (Bugzilla->user->authorizer->user_can_create_account) {
ThrowUserError("auth_cant_create_account"); ThrowUserError("auth_cant_create_account");
} }
my $createexp = Param('createemailregexp'); my $createexp = Bugzilla->params->{'createemailregexp'};
unless ($createexp) { unless ($createexp) {
ThrowUserError("account_creation_disabled"); ThrowUserError("account_creation_disabled");
} }
......
...@@ -132,7 +132,7 @@ if (!tie(%dbmcount, 'AnyDBM_File', "$datadir/duplicates/dupes$today", ...@@ -132,7 +132,7 @@ if (!tie(%dbmcount, 'AnyDBM_File', "$datadir/duplicates/dupes$today",
# Remove all those dupes under the threshold parameter. # Remove all those dupes under the threshold parameter.
# We do this, before the sorting, for performance reasons. # We do this, before the sorting, for performance reasons.
my $threshold = Param("mostfreqthreshold"); my $threshold = Bugzilla->params->{"mostfreqthreshold"};
while (my ($key, $value) = each %count) { while (my ($key, $value) = each %count) {
delete $count{$key} if ($value < $threshold); delete $count{$key} if ($value < $threshold);
......
...@@ -59,7 +59,8 @@ exists Bugzilla->user->groups->{'editclassifications'} ...@@ -59,7 +59,8 @@ exists Bugzilla->user->groups->{'editclassifications'}
action => "edit", action => "edit",
object => "classifications"}); object => "classifications"});
ThrowUserError("auth_classification_not_enabled") unless Param("useclassification"); ThrowUserError("auth_classification_not_enabled")
unless Bugzilla->params->{"useclassification"};
# #
# often used variables # often used variables
......
...@@ -159,7 +159,7 @@ if ($action eq 'new') { ...@@ -159,7 +159,7 @@ if ($action eq 'new') {
{name => $comp_name}); {name => $comp_name});
my $default_assignee_id = login_to_id($default_assignee); 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; (login_to_id($default_qa_contact) || undef) : undef;
trick_taint($comp_name); trick_taint($comp_name);
...@@ -251,7 +251,7 @@ if ($action eq 'delete') { ...@@ -251,7 +251,7 @@ if ($action eq 'delete') {
Bugzilla::Component::check_component($product, $comp_name); Bugzilla::Component::check_component($product, $comp_name);
if ($component->bug_count) { if ($component->bug_count) {
if (Param("allowbugdeletion")) { if (Bugzilla->params->{"allowbugdeletion"}) {
foreach my $bug_id (@{$component->bug_ids}) { foreach my $bug_id (@{$component->bug_ids}) {
my $bug = new Bugzilla::Bug($bug_id, $whoid); my $bug = new Bugzilla::Bug($bug_id, $whoid);
$bug->remove_from_db(); $bug->remove_from_db();
...@@ -380,7 +380,7 @@ if ($action eq 'update') { ...@@ -380,7 +380,7 @@ if ($action eq 'update') {
$vars->{'updated_initialowner'} = 1; $vars->{'updated_initialowner'} = 1;
} }
if (Param('useqacontact') if (Bugzilla->params->{'useqacontact'}
&& $default_qa_contact ne $component_old->default_qa_contact->login) { && $default_qa_contact ne $component_old->default_qa_contact->login) {
$dbh->do("UPDATE components SET initialqacontact = ? $dbh->do("UPDATE components SET initialqacontact = ?
WHERE id = ?", undef, WHERE id = ?", undef,
......
...@@ -342,7 +342,7 @@ if ($action eq 'del') { ...@@ -342,7 +342,7 @@ if ($action eq 'del') {
# Groups having a special role cannot be deleted. # Groups having a special role cannot be deleted.
my @special_groups; my @special_groups;
foreach my $special_group ('chartgroup', 'insidergroup', 'timetrackinggroup') { 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); push(@special_groups, $special_group);
} }
} }
...@@ -406,7 +406,7 @@ if ($action eq 'delete') { ...@@ -406,7 +406,7 @@ if ($action eq 'delete') {
# Groups having a special role cannot be deleted. # Groups having a special role cannot be deleted.
my @special_groups; my @special_groups;
foreach my $special_group ('chartgroup', 'insidergroup', 'timetrackinggroup') { 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); push(@special_groups, $special_group);
} }
} }
...@@ -625,7 +625,7 @@ sub doGroupChanges { ...@@ -625,7 +625,7 @@ sub doGroupChanges {
# these parameters too. # these parameters too.
my $update_params = 0; my $update_params = 0;
foreach my $group ('chartgroup', 'insidergroup', 'timetrackinggroup') { foreach my $group ('chartgroup', 'insidergroup', 'timetrackinggroup') {
if ($cgi->param('oldname') eq Param($group)) { if ($cgi->param('oldname') eq Bugzilla->params->{$group}) {
SetParam($group, $name); SetParam($group, $name);
$update_params = 1; $update_params = 1;
} }
...@@ -690,7 +690,7 @@ sub doGroupChanges { ...@@ -690,7 +690,7 @@ sub doGroupChanges {
} }
my $cansee = $cgi->param("cansee-$v") || 0; my $cansee = $cgi->param("cansee-$v") || 0;
if (Param("usevisibilitygroups") if (Bugzilla->params->{"usevisibilitygroups"}
&& ($cgi->param("oldcansee-$v") != $cansee)) { && ($cgi->param("oldcansee-$v") != $cansee)) {
$chgs = 1; $chgs = 1;
if ($cansee != 0) { if ($cansee != 0) {
......
...@@ -89,7 +89,7 @@ if ($action eq 'save' && $current_module) { ...@@ -89,7 +89,7 @@ if ($action eq 'save' && $current_module) {
my $changed; my $changed;
if ($i->{'type'} eq 'm') { if ($i->{'type'} eq 'm') {
my @old = sort @{Param($name)}; my @old = sort @{Bugzilla->params->{$name}};
my @new = sort @$value; my @new = sort @$value;
if (scalar(@old) != scalar(@new)) { if (scalar(@old) != scalar(@new)) {
$changed = 1; $changed = 1;
...@@ -104,7 +104,7 @@ if ($action eq 'save' && $current_module) { ...@@ -104,7 +104,7 @@ if ($action eq 'save' && $current_module) {
} }
} }
} else { } else {
$changed = ($value eq Param($name))? 0 : 1; $changed = ($value eq Bugzilla->params->{$name})? 0 : 1;
} }
if ($changed) { if ($changed) {
......
...@@ -81,7 +81,7 @@ my $showbugcounts = (defined $cgi->param('showbugcounts')); ...@@ -81,7 +81,7 @@ my $showbugcounts = (defined $cgi->param('showbugcounts'));
# classifications enabled) # classifications enabled)
# #
if (Param('useclassification') if (Bugzilla->params->{'useclassification'}
&& !$classification_name && !$classification_name
&& !$product_name) && !$product_name)
{ {
...@@ -101,7 +101,7 @@ if (Param('useclassification') ...@@ -101,7 +101,7 @@ if (Param('useclassification')
if (!$action && !$product_name) { if (!$action && !$product_name) {
my $products; my $products;
if (Param('useclassification')) { if (Bugzilla->params->{'useclassification'}) {
my $classification = my $classification =
Bugzilla::Classification::check_classification($classification_name); Bugzilla::Classification::check_classification($classification_name);
...@@ -130,7 +130,7 @@ if (!$action && !$product_name) { ...@@ -130,7 +130,7 @@ if (!$action && !$product_name) {
if ($action eq 'add') { if ($action eq 'add') {
if (Param('useclassification')) { if (Bugzilla->params->{'useclassification'}) {
my $classification = my $classification =
Bugzilla::Classification::check_classification($classification_name); Bugzilla::Classification::check_classification($classification_name);
$vars->{'classification'} = $classification; $vars->{'classification'} = $classification;
...@@ -151,7 +151,7 @@ if ($action eq 'new') { ...@@ -151,7 +151,7 @@ if ($action eq 'new') {
# Cleanups and validity checks # Cleanups and validity checks
my $classification_id = 1; my $classification_id = 1;
if (Param('useclassification')) { if (Bugzilla->params->{'useclassification'}) {
my $classification = my $classification =
Bugzilla::Classification::check_classification($classification_name); Bugzilla::Classification::check_classification($classification_name);
$classification_id = $classification->id; $classification_id = $classification->id;
...@@ -232,7 +232,7 @@ if ($action eq 'new') { ...@@ -232,7 +232,7 @@ if ($action eq 'new') {
# If we're using bug groups, then we need to create a group for this # If we're using bug groups, then we need to create a group for this
# product as well. -JMR, 2/16/00 # product as well. -JMR, 2/16/00
if (Param("makeproductgroups")) { if (Bugzilla->params->{"makeproductgroups"}) {
# Next we insert into the groups table # Next we insert into the groups table
my $productgroup = $product->name; my $productgroup = $product->name;
while (new Bugzilla::Group({name => $productgroup})) { while (new Bugzilla::Group({name => $productgroup})) {
...@@ -265,7 +265,8 @@ if ($action eq 'new') { ...@@ -265,7 +265,8 @@ if ($action eq 'new') {
(group_id, product_id, entry, membercontrol, (group_id, product_id, entry, membercontrol,
othercontrol, canedit) othercontrol, canedit)
VALUES (?, ?, ?, ?, ?, ?)', VALUES (?, ?, ?, ?, ?, ?)',
undef, ($gid, $product->id, Param('useentrygroupdefault'), undef, ($gid, $product->id,
Bugzilla->params->{'useentrygroupdefault'},
CONTROLMAPDEFAULT, CONTROLMAPNA, 0)); CONTROLMAPDEFAULT, CONTROLMAPNA, 0));
} }
...@@ -328,7 +329,7 @@ if ($action eq 'del') { ...@@ -328,7 +329,7 @@ if ($action eq 'del') {
$user->can_see_product($product->name) $user->can_see_product($product->name)
|| ThrowUserError('product_access_denied', {product => $product->name}); || ThrowUserError('product_access_denied', {product => $product->name});
if (Param('useclassification')) { if (Bugzilla->params->{'useclassification'}) {
my $classification = my $classification =
Bugzilla::Classification::check_classification($classification_name); Bugzilla::Classification::check_classification($classification_name);
if ($classification->id != $product->classification_id) { if ($classification->id != $product->classification_id) {
...@@ -360,7 +361,7 @@ if ($action eq 'delete') { ...@@ -360,7 +361,7 @@ if ($action eq 'delete') {
$vars->{'product'} = $product; $vars->{'product'} = $product;
if (Param('useclassification')) { if (Bugzilla->params->{'useclassification'}) {
my $classification = my $classification =
Bugzilla::Classification::check_classification($classification_name); Bugzilla::Classification::check_classification($classification_name);
if ($classification->id != $product->classification_id) { if ($classification->id != $product->classification_id) {
...@@ -372,7 +373,7 @@ if ($action eq 'delete') { ...@@ -372,7 +373,7 @@ if ($action eq 'delete') {
} }
if ($product->bug_count) { if ($product->bug_count) {
if (Param("allowbugdeletion")) { if (Bugzilla->params->{"allowbugdeletion"}) {
foreach my $bug_id (@{$product->bug_ids}) { foreach my $bug_id (@{$product->bug_ids}) {
my $bug = new Bugzilla::Bug($bug_id, $whoid); my $bug = new Bugzilla::Bug($bug_id, $whoid);
$bug->remove_from_db(); $bug->remove_from_db();
...@@ -432,7 +433,7 @@ if ($action eq 'edit' || (!$action && $product_name)) { ...@@ -432,7 +433,7 @@ if ($action eq 'edit' || (!$action && $product_name)) {
$user->can_see_product($product->name) $user->can_see_product($product->name)
|| ThrowUserError('product_access_denied', {product => $product->name}); || ThrowUserError('product_access_denied', {product => $product->name});
if (Param('useclassification')) { if (Bugzilla->params->{'useclassification'}) {
my $classification; my $classification;
if (!$classification_name) { if (!$classification_name) {
$classification = $classification =
...@@ -755,7 +756,7 @@ if ($action eq 'update') { ...@@ -755,7 +756,7 @@ if ($action eq 'update') {
$user->can_see_product($product_old->name) $user->can_see_product($product_old->name)
|| ThrowUserError('product_access_denied', {product => $product_old->name}); || ThrowUserError('product_access_denied', {product => $product_old->name});
if (Param('useclassification')) { if (Bugzilla->params->{'useclassification'}) {
my $classification; my $classification;
if (!$classification_name) { if (!$classification_name) {
$classification = $classification =
...@@ -811,7 +812,7 @@ if ($action eq 'update') { ...@@ -811,7 +812,7 @@ if ($action eq 'update') {
} }
# Only update milestone related stuff if 'usetargetmilestone' is on. # Only update milestone related stuff if 'usetargetmilestone' is on.
if (Param('usetargetmilestone')) { if (Bugzilla->params->{'usetargetmilestone'}) {
my $milestone = new Bugzilla::Milestone($product_old->id, my $milestone = new Bugzilla::Milestone($product_old->id,
$defaultmilestone); $defaultmilestone);
......
...@@ -88,7 +88,7 @@ if ($action eq 'search') { ...@@ -88,7 +88,7 @@ if ($action eq 'search') {
$group || ThrowUserError('invalid_group_ID'); $group || ThrowUserError('invalid_group_ID');
} }
if (!$editusers && Param('usevisibilitygroups')) { if (!$editusers && Bugzilla->params->{'usevisibilitygroups'}) {
# Show only users in visible groups. # Show only users in visible groups.
$visibleGroups = $user->visible_groups_as_string(); $visibleGroups = $user->visible_groups_as_string();
...@@ -426,7 +426,8 @@ if ($action eq 'search') { ...@@ -426,7 +426,8 @@ if ($action eq 'search') {
my $otherUser = check_user($otherUserID, $otherUserLogin); my $otherUser = check_user($otherUserID, $otherUserLogin);
$otherUserID = $otherUser->id; $otherUserID = $otherUser->id;
Param('allowuserdeletion') || ThrowUserError('users_deletion_disabled'); Bugzilla->params->{'allowuserdeletion'}
|| ThrowUserError('users_deletion_disabled');
$editusers || ThrowUserError('auth_failure', {group => "editusers", $editusers || ThrowUserError('auth_failure', {group => "editusers",
action => "delete", action => "delete",
object => "users"}); object => "users"});
...@@ -534,7 +535,7 @@ if ($action eq 'search') { ...@@ -534,7 +535,7 @@ if ($action eq 'search') {
'whine_queries WRITE', 'whine_queries WRITE',
'whine_events WRITE'); 'whine_events WRITE');
Param('allowuserdeletion') Bugzilla->params->{'allowuserdeletion'}
|| ThrowUserError('users_deletion_disabled'); || ThrowUserError('users_deletion_disabled');
$editusers || ThrowUserError('auth_failure', $editusers || ThrowUserError('auth_failure',
{group => "editusers", {group => "editusers",
......
...@@ -156,7 +156,7 @@ unless ($action) { ...@@ -156,7 +156,7 @@ unless ($action) {
{Slice =>{}}); {Slice =>{}});
$vars->{'field'} = $field; $vars->{'field'} = $field;
$vars->{'values'} = $fieldvalues; $vars->{'values'} = $fieldvalues;
$vars->{'default'} = Param($defaults{$field}); $vars->{'default'} = Bugzilla->params->{$defaults{$field}};
$template->process("admin/fieldvalues/list.html.tmpl", $template->process("admin/fieldvalues/list.html.tmpl",
$vars) $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -258,7 +258,7 @@ if ($action eq 'del') { ...@@ -258,7 +258,7 @@ if ($action eq 'del') {
# #
if ($action eq 'delete') { if ($action eq 'delete') {
ValueMustExist($field, $value); ValueMustExist($field, $value);
if ($value eq Param($defaults{$field})) { if ($value eq Bugzilla->params->{$defaults{$field}}) {
ThrowUserError('fieldvalue_is_default', {field => $field, ThrowUserError('fieldvalue_is_default', {field => $field,
value => $value, value => $value,
param_name => $defaults{$field}}) param_name => $defaults{$field}})
...@@ -381,7 +381,7 @@ if ($action eq 'update') { ...@@ -381,7 +381,7 @@ if ($action eq 'update') {
# This update is done while tables are unlocked due to the # This update is done while tables are unlocked due to the
# annoying calls in Bugzilla/Config/Common.pm. # annoying calls in Bugzilla/Config/Common.pm.
if ($value ne $valueold if ($value ne $valueold
&& $valueold eq Param($defaults{$field})) && $valueold eq Bugzilla->params->{$defaults{$field}})
{ {
SetParam($defaults{$field}, $value); SetParam($defaults{$field}, $value);
WriteParams(); WriteParams();
......
...@@ -237,7 +237,7 @@ if ($cgi->param('update')) { ...@@ -237,7 +237,7 @@ if ($cgi->param('update')) {
if ($can_mail_others && $mailto) { if ($can_mail_others && $mailto) {
if ($mailto_type == MAILTO_USER) { if ($mailto_type == MAILTO_USER) {
# detaint # detaint
my $emailregexp = Param('emailregexp'); my $emailregexp = Bugzilla->params->{'emailregexp'};
if ($mailto =~ /($emailregexp)/) { if ($mailto =~ /($emailregexp)/) {
$mailto_id = login_to_id($1); $mailto_id = login_to_id($1);
} }
......
...@@ -70,7 +70,7 @@ if ($product_name eq '') { ...@@ -70,7 +70,7 @@ if ($product_name eq '') {
my @enterable_products = @{$user->get_enterable_products}; my @enterable_products = @{$user->get_enterable_products};
ThrowUserError('no_products') unless scalar(@enterable_products); ThrowUserError('no_products') unless scalar(@enterable_products);
my $classification = Param('useclassification') ? my $classification = Bugzilla->params->{'useclassification'} ?
scalar($cgi->param('classification')) : '__all'; scalar($cgi->param('classification')) : '__all';
unless ($classification) { unless ($classification) {
...@@ -170,8 +170,8 @@ sub pickplatform { ...@@ -170,8 +170,8 @@ sub pickplatform {
my @platform; my @platform;
if (Param('defaultplatform')) { if (Bugzilla->params->{'defaultplatform'}) {
@platform = Param('defaultplatform'); @platform = Bugzilla->params->{'defaultplatform'};
} else { } else {
# If @platform is a list, this function will return the first # If @platform is a list, this function will return the first
# item in the list that is a valid platform choice. If # item in the list that is a valid platform choice. If
...@@ -228,8 +228,8 @@ sub pickos { ...@@ -228,8 +228,8 @@ sub pickos {
my @os; my @os;
if (Param('defaultopsys')) { if (Bugzilla->params->{'defaultopsys'}) {
@os = Param('defaultopsys'); @os = Bugzilla->params->{'defaultopsys'};
} else { } else {
# This function will return the first # This function will return the first
# item in @os that is a valid platform choice. If # item in @os that is a valid platform choice. If
...@@ -367,8 +367,8 @@ if ($cloned_bug_id) { ...@@ -367,8 +367,8 @@ if ($cloned_bug_id) {
$vars->{'commentprivacy'} = 0; $vars->{'commentprivacy'} = 0;
if ( !($isprivate) || if ( !($isprivate) ||
( ( Param("insidergroup") ) && ( ( Bugzilla->params->{"insidergroup"} ) &&
( UserInGroup(Param("insidergroup")) ) ) ( UserInGroup(Bugzilla->params->{"insidergroup"}) ) )
) { ) {
$vars->{'comment'} = $cloned_bug->{'longdescs'}->[0]->{'body'}; $vars->{'comment'} = $cloned_bug->{'longdescs'}->[0]->{'body'};
$vars->{'commentprivacy'} = $isprivate; $vars->{'commentprivacy'} = $isprivate;
...@@ -382,8 +382,8 @@ if ($cloned_bug_id) { ...@@ -382,8 +382,8 @@ if ($cloned_bug_id) {
else { else {
$default{'component_'} = formvalue('component'); $default{'component_'} = formvalue('component');
$default{'priority'} = formvalue('priority', Param('defaultpriority')); $default{'priority'} = formvalue('priority', Bugzilla->params->{'defaultpriority'});
$default{'bug_severity'} = formvalue('bug_severity', Param('defaultseverity')); $default{'bug_severity'} = formvalue('bug_severity', Bugzilla->params->{'defaultseverity'});
$default{'rep_platform'} = pickplatform(); $default{'rep_platform'} = pickplatform();
$default{'op_sys'} = pickos(); $default{'op_sys'} = pickos();
...@@ -430,7 +430,7 @@ if ( ($cloned_bug_id) && ...@@ -430,7 +430,7 @@ if ( ($cloned_bug_id) &&
} }
# Get list of milestones. # Get list of milestones.
if ( Param('usetargetmilestone') ) { if ( Bugzilla->params->{'usetargetmilestone'} ) {
$vars->{'target_milestone'} = [map($_->name, @{$product->milestones})]; $vars->{'target_milestone'} = [map($_->name, @{$product->milestones})];
if (formvalue('target_milestone')) { if (formvalue('target_milestone')) {
$default{'target_milestone'} = formvalue('target_milestone'); $default{'target_milestone'} = formvalue('target_milestone');
......
...@@ -120,6 +120,7 @@ our @attachments; ...@@ -120,6 +120,7 @@ our @attachments;
our $bugtotal; our $bugtotal;
my $xml; my $xml;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $params = Bugzilla->params;
my ($timestamp) = $dbh->selectrow_array("SELECT NOW()"); my ($timestamp) = $dbh->selectrow_array("SELECT NOW()");
############################################################################### ###############################################################################
...@@ -131,7 +132,7 @@ sub MailMessage { ...@@ -131,7 +132,7 @@ sub MailMessage {
my $subject = shift; my $subject = shift;
my $message = shift; my $message = shift;
my @recipients = @_; my @recipients = @_;
my $from = Param("moved-from-address"); my $from = $params->{"moved-from-address"};
$from =~ s/@/\@/g; $from =~ s/@/\@/g;
foreach my $to (@recipients){ foreach my $to (@recipients){
...@@ -158,8 +159,8 @@ sub Error { ...@@ -158,8 +159,8 @@ sub Error {
my $subject = "Bug import error: $reason"; my $subject = "Bug import error: $reason";
my $message = "Cannot import these bugs because $reason "; my $message = "Cannot import these bugs because $reason ";
$message .= "\n\nPlease re-open the original bug.\n" if ($errtype); $message .= "\n\nPlease re-open the original bug.\n" if ($errtype);
$message .= "For more info, contact " . Param("maintainer") . ".\n"; $message .= "For more info, contact " . $params->{"maintainer"} . ".\n";
my @to = ( Param("maintainer"), $exporter); my @to = ( $params->{"maintainer"}, $exporter);
Debug( $message, ERR_LEVEL ); Debug( $message, ERR_LEVEL );
MailMessage( $subject, $message, @to ); MailMessage( $subject, $message, @to );
exit; exit;
...@@ -315,23 +316,23 @@ sub init() { ...@@ -315,23 +316,23 @@ sub init() {
} }
Error( "no maintainer", "REOPEN", $exporter ) unless ($maintainer); Error( "no maintainer", "REOPEN", $exporter ) unless ($maintainer);
Error( "no exporter", "REOPEN", $exporter ) unless ($exporter); 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( "invalid exporter: $exporter", "REOPEN", $exporter ) if ( !login_to_id($exporter) );
Error( "no urlbase set", "REOPEN", $exporter ) unless ($urlbase); Error( "no urlbase set", "REOPEN", $exporter ) unless ($urlbase);
my $def_product = 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 || Error("Cannot import these bugs because an invalid default
product was defined for the target db." 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); moved-default-product. \n", "REOPEN", $exporter);
my $def_component = new Bugzilla::Component( my $def_component = new Bugzilla::Component(
{ {
product_id => $def_product->id, product_id => $def_product->id,
name => Param("moved-default-component") name => $params->{"moved-default-component"}
}) })
|| Error("Cannot import these bugs because an invalid default || Error("Cannot import these bugs because an invalid default
component was defined for the target db." 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); moved-default-component.\n", "REOPEN", $exporter);
} }
...@@ -487,7 +488,7 @@ sub process_bug { ...@@ -487,7 +488,7 @@ sub process_bug {
$long_desc{'isprivate'} = $comment->{'att'}->{'isprivate'} || 0; $long_desc{'isprivate'} = $comment->{'att'}->{'isprivate'} || 0;
# if one of the comments is private we need to set this flag # 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; $private = 1;
} }
my $data = $comment->field('thetext'); my $data = $comment->field('thetext');
...@@ -545,7 +546,7 @@ sub process_bug { ...@@ -545,7 +546,7 @@ sub process_bug {
$comments .= "\n\n--- Bug imported by $exporter_login "; $comments .= "\n\n--- Bug imported by $exporter_login ";
$comments .= time2str( "%Y-%m-%d %H:%M", time ) . " "; $comments .= time2str( "%Y-%m-%d %H:%M", time ) . " ";
$comments .= Param('timezone'); $comments .= $params->{'timezone'};
$comments .= " ---\n\n"; $comments .= " ---\n\n";
$comments .= "This bug was previously known as _bug_ $bug_fields{'bug_id'} at "; $comments .= "This bug was previously known as _bug_ $bug_fields{'bug_id'} at ";
$comments .= $urlbase . "show_bug.cgi?id=" . $bug_fields{'bug_id'} . "\n"; $comments .= $urlbase . "show_bug.cgi?id=" . $bug_fields{'bug_id'} . "\n";
...@@ -609,11 +610,11 @@ sub process_bug { ...@@ -609,11 +610,11 @@ sub process_bug {
# Product and Component if there is no valid default product and # Product and Component if there is no valid default product and
# component defined in the parameters, we wouldn't be here # component defined in the parameters, we wouldn't be here
my $def_product = 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( my $def_component = new Bugzilla::Component(
{ {
product_id => $def_product->id, product_id => $def_product->id,
name => Param("moved-default-component") name => $params->{"moved-default-component"}
} }
); );
my $product; my $product;
...@@ -681,7 +682,7 @@ sub process_bug { ...@@ -681,7 +682,7 @@ sub process_bug {
} }
# Milestone # Milestone
if ( Param("usetargetmilestone") ) { if ( $params->{"usetargetmilestone"} ) {
my $milestone = my $milestone =
new Bugzilla::Milestone( $product->id, new Bugzilla::Milestone( $product->id,
$bug_fields{'target_milestone'} ); $bug_fields{'target_milestone'} );
...@@ -710,13 +711,13 @@ sub process_bug { ...@@ -710,13 +711,13 @@ sub process_bug {
push( @values, $bug_fields{'bug_severity'} ); push( @values, $bug_fields{'bug_severity'} );
} }
else { else {
push( @values, Param('defaultseverity') ); push( @values, $params->{'defaultseverity'} );
$err .= "Unknown severity "; $err .= "Unknown severity ";
$err .= ( defined $bug_fields{'bug_severity'} ) $err .= ( defined $bug_fields{'bug_severity'} )
? $bug_fields{'bug_severity'} ? $bug_fields{'bug_severity'}
: "unknown"; : "unknown";
$err .= ". Setting to default severity \""; $err .= ". Setting to default severity \"";
$err .= Param('defaultseverity') . "\".\n"; $err .= $params->{'defaultseverity'} . "\".\n";
} }
push( @query, "bug_severity" ); push( @query, "bug_severity" );
...@@ -727,13 +728,13 @@ sub process_bug { ...@@ -727,13 +728,13 @@ sub process_bug {
push( @values, $bug_fields{'priority'} ); push( @values, $bug_fields{'priority'} );
} }
else { else {
push( @values, Param('defaultpriority') ); push( @values, $params->{'defaultpriority'} );
$err .= "Unknown priority "; $err .= "Unknown priority ";
$err .= ( defined $bug_fields{'priority'} ) $err .= ( defined $bug_fields{'priority'} )
? $bug_fields{'priority'} ? $bug_fields{'priority'}
: "unknown"; : "unknown";
$err .= ". Setting to default priority \""; $err .= ". Setting to default priority \"";
$err .= Param('defaultpriority') . "\".\n"; $err .= $params->{'defaultpriority'} . "\".\n";
} }
push( @query, "priority" ); push( @query, "priority" );
...@@ -744,13 +745,13 @@ sub process_bug { ...@@ -744,13 +745,13 @@ sub process_bug {
push( @values, $bug_fields{'rep_platform'} ); push( @values, $bug_fields{'rep_platform'} );
} }
else { else {
push( @values, Param('defaultplatform') ); push( @values, $params->{'defaultplatform'} );
$err .= "Unknown platform "; $err .= "Unknown platform ";
$err .= ( defined $bug_fields{'rep_platform'} ) $err .= ( defined $bug_fields{'rep_platform'} )
? $bug_fields{'rep_platform'} ? $bug_fields{'rep_platform'}
: "unknown"; : "unknown";
$err .=". Setting to default platform \""; $err .=". Setting to default platform \"";
$err .= Param('defaultplatform') . "\".\n"; $err .= $params->{'defaultplatform'} . "\".\n";
} }
push( @query, "rep_platform" ); push( @query, "rep_platform" );
...@@ -761,17 +762,17 @@ sub process_bug { ...@@ -761,17 +762,17 @@ sub process_bug {
push( @values, $bug_fields{'op_sys'} ); push( @values, $bug_fields{'op_sys'} );
} }
else { else {
push( @values, Param('defaultopsys') ); push( @values, $params->{'defaultopsys'} );
$err .= "Unknown operating system "; $err .= "Unknown operating system ";
$err .= ( defined $bug_fields{'op_sys'} ) $err .= ( defined $bug_fields{'op_sys'} )
? $bug_fields{'op_sys'} ? $bug_fields{'op_sys'}
: "unknown"; : "unknown";
$err .= ". Setting to default OS \"" . Param('defaultopsys') . "\".\n"; $err .= ". Setting to default OS \"" . $params->{'defaultopsys'} . "\".\n";
} }
push( @query, "op_sys" ); push( @query, "op_sys" );
# Process time fields # Process time fields
if ( Param("timetrackinggroup") ) { if ( $params->{"timetrackinggroup"} ) {
my $date = format_time( $bug_fields{'deadline'}, "%Y-%m-%d" ) my $date = format_time( $bug_fields{'deadline'}, "%Y-%m-%d" )
|| undef; || undef;
push( @values, $date ); push( @values, $date );
...@@ -841,7 +842,7 @@ sub process_bug { ...@@ -841,7 +842,7 @@ sub process_bug {
} }
} }
if ( Param("useqacontact") ) { if ( $params->{"useqacontact"} ) {
my $qa_contact; my $qa_contact;
push( @query, "qa_contact" ); push( @query, "qa_contact" );
if ( ( defined $bug_fields{'qa_contact'}) if ( ( defined $bug_fields{'qa_contact'})
...@@ -1079,7 +1080,7 @@ sub process_bug { ...@@ -1079,7 +1080,7 @@ sub process_bug {
$err .= "No attachment ID specified, dropping attachment\n"; $err .= "No attachment ID specified, dropping attachment\n";
next; 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 .= "Exporter not in insidergroup and attachment marked private.\n";
$err .= " Marking attachment public\n"; $err .= " Marking attachment public\n";
$att->{'isprivate'} = 0; $att->{'isprivate'} = 0;
...@@ -1118,7 +1119,7 @@ sub process_bug { ...@@ -1118,7 +1119,7 @@ sub process_bug {
# Insert longdesc and append any errors # Insert longdesc and append any errors
my $worktime = $bug_fields{'actual_time'} || 0.0; 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; $long_description .= "\n" . $comments;
if ($err) { if ($err) {
$long_description .= "\n$err\n"; $long_description .= "\n$err\n";
...@@ -1142,7 +1143,7 @@ sub process_bug { ...@@ -1142,7 +1143,7 @@ sub process_bug {
$log .= "Bug ${urlbase}show_bug.cgi?id=$bug_fields{'bug_id'} "; $log .= "Bug ${urlbase}show_bug.cgi?id=$bug_fields{'bug_id'} ";
$log .= "imported as bug $id.\n"; $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) { if ($err) {
$log .= "The following problems were encountered while creating bug $id.\n"; $log .= "The following problems were encountered while creating bug $id.\n";
$log .= $err; $log .= $err;
...@@ -1193,7 +1194,7 @@ my $urlbase = $root->{'att'}->{'urlbase'}; ...@@ -1193,7 +1194,7 @@ my $urlbase = $root->{'att'}->{'urlbase'};
my $log = join("\n\n", @logs); my $log = join("\n\n", @logs);
$log .= "\n\nImported $bugtotal bug(s) from $urlbase,\n sent by $exporter.\n"; $log .= "\n\nImported $bugtotal bug(s) from $urlbase,\n sent by $exporter.\n";
my $subject = "$bugtotal Bug(s) successfully moved from $urlbase to " my $subject = "$bugtotal Bug(s) successfully moved from $urlbase to "
. Param("urlbase"); . $params->{"urlbase"};
my @to = ($exporter, $maintainer); my @to = ($exporter, $maintainer);
MailMessage( $subject, $log, @to ); MailMessage( $subject, $log, @to );
......
...@@ -45,10 +45,10 @@ my $user = Bugzilla->login(LOGIN_OPTIONAL); ...@@ -45,10 +45,10 @@ my $user = Bugzilla->login(LOGIN_OPTIONAL);
############################################################################### ###############################################################################
my $cgi = Bugzilla->cgi; 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. # This is required because the user may want to log in from here.
if (Param('sslbase') ne '' and Param('ssl') ne 'never') { if (Bugzilla->params->{'sslbase'} ne '' and Bugzilla->params->{'ssl'} ne 'never') {
$cgi->require_https(Param('sslbase')); $cgi->require_https(Bugzilla->params->{'sslbase'});
} }
my $template = Bugzilla->template; my $template = Bugzilla->template;
......
...@@ -156,7 +156,7 @@ if (!defined $cgi->param('short_desc') ...@@ -156,7 +156,7 @@ if (!defined $cgi->param('short_desc')
# Check that if required a description has been provided # Check that if required a description has been provided
# This has to go somewhere after 'maketemplate' # This has to go somewhere after 'maketemplate'
# or it breaks bookmarks with no comments. # 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"); ThrowUserError("description_required");
} }
...@@ -181,7 +181,7 @@ my @bug_fields = ("version", "rep_platform", ...@@ -181,7 +181,7 @@ my @bug_fields = ("version", "rep_platform",
"bug_status", "everconfirmed", "bug_file_loc", "short_desc", "bug_status", "everconfirmed", "bug_file_loc", "short_desc",
"target_milestone", "status_whiteboard"); "target_milestone", "status_whiteboard");
if (Param("usebugaliases")) { if (Bugzilla->params->{"usebugaliases"}) {
my $alias = trim($cgi->param('alias') || ""); my $alias = trim($cgi->param('alias') || "");
if ($alias ne "") { if ($alias ne "") {
ValidateBugAlias($alias); ValidateBugAlias($alias);
...@@ -191,7 +191,7 @@ if (Param("usebugaliases")) { ...@@ -191,7 +191,7 @@ if (Param("usebugaliases")) {
} }
# Retrieve the default QA contact if the field is empty # Retrieve the default QA contact if the field is empty
if (Param("useqacontact")) { if (Bugzilla->params->{"useqacontact"}) {
my $qa_contact; my $qa_contact;
if (!UserInGroup("editbugs") || !defined $cgi->param('qa_contact') if (!UserInGroup("editbugs") || !defined $cgi->param('qa_contact')
|| trim($cgi->param('qa_contact')) eq "") { || trim($cgi->param('qa_contact')) eq "") {
...@@ -235,8 +235,8 @@ if (!defined $cgi->param('target_milestone')) { ...@@ -235,8 +235,8 @@ if (!defined $cgi->param('target_milestone')) {
$cgi->param(-name => 'target_milestone', -value => $defaultmilestone); $cgi->param(-name => 'target_milestone', -value => $defaultmilestone);
} }
if (!Param('letsubmitterchoosepriority')) { if (!Bugzilla->params->{'letsubmitterchoosepriority'}) {
$cgi->param(-name => 'priority', -value => Param('defaultpriority')); $cgi->param(-name => 'priority', -value => Bugzilla->params->{'defaultpriority'});
} }
# Some more sanity checking # Some more sanity checking
...@@ -305,11 +305,11 @@ if ($cgi->param('keywords') && UserInGroup("editbugs")) { ...@@ -305,11 +305,11 @@ if ($cgi->param('keywords') && UserInGroup("editbugs")) {
} }
} }
if (Param("strict_isolation")) { if (Bugzilla->params->{"strict_isolation"}) {
my @blocked_users = (); my @blocked_users = ();
my %related_users = %ccids; my %related_users = %ccids;
$related_users{$cgi->param('assigned_to')} = 1; $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; $related_users{$cgi->param('qa_contact')} = 1;
} }
foreach my $pid (keys %related_users) { foreach my $pid (keys %related_users) {
...@@ -382,7 +382,7 @@ my $est_time = 0; ...@@ -382,7 +382,7 @@ my $est_time = 0;
my $deadline; my $deadline;
# Time Tracking # Time Tracking
if (UserInGroup(Param("timetrackinggroup")) && if (UserInGroup(Bugzilla->params->{"timetrackinggroup"}) &&
defined $cgi->param('estimated_time')) { defined $cgi->param('estimated_time')) {
$est_time = $cgi->param('estimated_time'); $est_time = $cgi->param('estimated_time');
...@@ -393,7 +393,9 @@ if (UserInGroup(Param("timetrackinggroup")) && ...@@ -393,7 +393,9 @@ if (UserInGroup(Param("timetrackinggroup")) &&
push (@fields_values, $est_time, $est_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')) validate_date($cgi->param('deadline'))
|| ThrowUserError('illegal_date', {date => $cgi->param('deadline'), || ThrowUserError('illegal_date', {date => $cgi->param('deadline'),
format => 'YYYY-MM-DD'}); format => 'YYYY-MM-DD'});
...@@ -481,7 +483,9 @@ foreach my $grouptoadd (@groupstoadd) { ...@@ -481,7 +483,9 @@ foreach my $grouptoadd (@groupstoadd) {
# Add the initial comment, allowing for the fact that it may be private # Add the initial comment, allowing for the fact that it may be private
my $privacy = 0; my $privacy = 0;
if (Param("insidergroup") && UserInGroup(Param("insidergroup"))) { if (Bugzilla->params->{"insidergroup"}
&& UserInGroup(Bugzilla->params->{"insidergroup"}))
{
$privacy = $cgi->param('commentprivacy') ? 1 : 0; $privacy = $cgi->param('commentprivacy') ? 1 : 0;
} }
......
...@@ -160,7 +160,7 @@ foreach my $field ("estimated_time", "work_time", "remaining_time") { ...@@ -160,7 +160,7 @@ foreach my $field ("estimated_time", "work_time", "remaining_time") {
} }
} }
if (UserInGroup(Param('timetrackinggroup'))) { if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) {
my $wk_time = $cgi->param('work_time'); my $wk_time = $cgi->param('work_time');
if ($cgi->param('comment') =~ /^\s*$/ && $wk_time && $wk_time != 0) { if ($cgi->param('comment') =~ /^\s*$/ && $wk_time && $wk_time != 0) {
ThrowUserError('comment_required'); ThrowUserError('comment_required');
...@@ -190,7 +190,7 @@ foreach my $field ("dependson", "blocked") { ...@@ -190,7 +190,7 @@ foreach my $field ("dependson", "blocked") {
# ValidateBugID is called without $field here so that it will # ValidateBugID is called without $field here so that it will
# throw an error if any of the changed bugs are not visible. # throw an error if any of the changed bugs are not visible.
ValidateBugID($id); ValidateBugID($id);
if (Param("strict_isolation")) { if (Bugzilla->params->{"strict_isolation"}) {
my $deltabug = new Bugzilla::Bug($id, $user->id); my $deltabug = new Bugzilla::Bug($id, $user->id);
if (!$user->can_edit_product($deltabug->{'product_id'})) { if (!$user->can_edit_product($deltabug->{'product_id'})) {
$vars->{'field'} = $field; $vars->{'field'} = $field;
...@@ -272,7 +272,7 @@ sub CheckonComment { ...@@ -272,7 +272,7 @@ sub CheckonComment {
my ($function) = (@_); my ($function) = (@_);
# Param is 1 if comment should be added ! # 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. # Allow without comment in case of undefined Params.
$ret = 0 unless ( defined( $ret )); $ret = 0 unless ( defined( $ret ));
...@@ -354,7 +354,7 @@ if (((defined $cgi->param('id') && $cgi->param('product') ne $oldproduct) ...@@ -354,7 +354,7 @@ if (((defined $cgi->param('id') && $cgi->param('product') ne $oldproduct)
my $mok = 1; # so it won't affect the 'if' statement if milestones aren't used my $mok = 1; # so it won't affect the 'if' statement if milestones aren't used
my @milestone_names = (); my @milestone_names = ();
if ( Param("usetargetmilestone") ) { if ( Bugzilla->params->{"usetargetmilestone"} ) {
defined($cgi->param('target_milestone')) defined($cgi->param('target_milestone'))
|| ThrowCodeError('undefined_field', { field => 'target_milestone' }); || ThrowCodeError('undefined_field', { field => 'target_milestone' });
...@@ -382,7 +382,7 @@ if (((defined $cgi->param('id') && $cgi->param('product') ne $oldproduct) ...@@ -382,7 +382,7 @@ if (((defined $cgi->param('id') && $cgi->param('product') ne $oldproduct)
if ($cok) { if ($cok) {
$defaults{'component'} = $cgi->param('component'); $defaults{'component'} = $cgi->param('component');
} }
if (Param("usetargetmilestone")) { if (Bugzilla->params->{"usetargetmilestone"}) {
$vars->{'use_target_milestone'} = 1; $vars->{'use_target_milestone'} = 1;
$vars->{'milestones'} = \@milestone_names; $vars->{'milestones'} = \@milestone_names;
if ($mok) { if ($mok) {
...@@ -464,7 +464,7 @@ if (defined $cgi->param('id')) { ...@@ -464,7 +464,7 @@ if (defined $cgi->param('id')) {
[map($_->name, @{$prod_obj->components})]); [map($_->name, @{$prod_obj->components})]);
check_field('version', scalar $cgi->param('version'), check_field('version', scalar $cgi->param('version'),
[map($_->name, @{$prod_obj->versions})]); [map($_->name, @{$prod_obj->versions})]);
if ( Param("usetargetmilestone") ) { if ( Bugzilla->params->{"usetargetmilestone"} ) {
check_field('target_milestone', scalar $cgi->param('target_milestone'), check_field('target_milestone', scalar $cgi->param('target_milestone'),
[map($_->name, @{$prod_obj->milestones})]); [map($_->name, @{$prod_obj->milestones})]);
} }
...@@ -487,8 +487,8 @@ if (defined $cgi->param('id')) { ...@@ -487,8 +487,8 @@ if (defined $cgi->param('id')) {
my $action = trim($cgi->param('action') || ''); my $action = trim($cgi->param('action') || '');
if ($action eq Param('move-button-text')) { if ($action eq Bugzilla->params->{'move-button-text'}) {
Param('move-enabled') || ThrowUserError("move_bugs_disabled"); Bugzilla->params->{'move-enabled'} || ThrowUserError("move_bugs_disabled");
$user->is_mover || ThrowUserError("auth_failure", {action => 'move', $user->is_mover || ThrowUserError("auth_failure", {action => 'move',
object => 'bugs'}); object => 'bugs'});
...@@ -506,7 +506,7 @@ if ($action eq Param('move-button-text')) { ...@@ -506,7 +506,7 @@ if ($action eq Param('move-button-text')) {
if (defined $cgi->param('comment') && $cgi->param('comment') !~ /^\s*$/) { if (defined $cgi->param('comment') && $cgi->param('comment') !~ /^\s*$/) {
$comment = $cgi->param('comment') . "\n\n"; $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 .= "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 .= "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"; $comment .= "If all went well, please mark this bug verified, and paste\n";
...@@ -553,9 +553,9 @@ if ($action eq Param('move-button-text')) { ...@@ -553,9 +553,9 @@ if ($action eq Param('move-button-text')) {
$vars->{'header_done'} = 1; $vars->{'header_done'} = 1;
} }
# Prepare and send all data about these bugs to the new database # 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/@/\@/; $to =~ s/@/\@/;
my $from = Param('moved-from-address'); my $from = Bugzilla->params->{'moved-from-address'};
$from =~ s/@/\@/; $from =~ s/@/\@/;
my $msg = "To: $to\n"; my $msg = "To: $to\n";
$msg .= "From: Bugzilla <" . $from . ">\n"; $msg .= "From: Bugzilla <" . $from . ">\n";
...@@ -591,7 +591,7 @@ my @values; ...@@ -591,7 +591,7 @@ my @values;
umask(0); umask(0);
sub _remove_remaining_time { sub _remove_remaining_time {
if (UserInGroup(Param('timetrackinggroup'))) { if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) {
if ( defined $cgi->param('remaining_time') if ( defined $cgi->param('remaining_time')
&& $cgi->param('remaining_time') > 0 ) && $cgi->param('remaining_time') > 0 )
{ {
...@@ -817,7 +817,7 @@ if ($cgi->param('component') ne $cgi->param('dontchange')) { ...@@ -817,7 +817,7 @@ if ($cgi->param('component') ne $cgi->param('dontchange')) {
# If this installation uses bug aliases, and the user is changing the alias, # If this installation uses bug aliases, and the user is changing the alias,
# add this change to the query. # 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')); my $alias = trim($cgi->param('alias'));
# Since aliases are unique (like bug numbers), they can only be changed # Since aliases are unique (like bug numbers), they can only be changed
...@@ -863,8 +863,10 @@ if (defined $cgi->param('id')) { ...@@ -863,8 +863,10 @@ if (defined $cgi->param('id')) {
} }
} }
if (defined $cgi->param('id') && if ( defined $cgi->param('id') &&
(Param("insidergroup") && UserInGroup(Param("insidergroup")))) { (Bugzilla->params->{"insidergroup"}
&& UserInGroup(Bugzilla->params->{"insidergroup"})) )
{
my $sth = $dbh->prepare('UPDATE longdescs SET isprivate = ? my $sth = $dbh->prepare('UPDATE longdescs SET isprivate = ?
WHERE bug_id = ? AND bug_when = ?'); WHERE bug_id = ? AND bug_when = ?');
...@@ -953,7 +955,7 @@ if (defined $cgi->param('qa_contact') ...@@ -953,7 +955,7 @@ if (defined $cgi->param('qa_contact')
# The QA contact cannot be deleted from show_bug.cgi for a single bug! # The QA contact cannot be deleted from show_bug.cgi for a single bug!
if ($name ne $cgi->param('dontchange')) { if ($name ne $cgi->param('dontchange')) {
$qacontact = login_to_id($name, THROW_ERROR) if ($name ne ""); $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); $usercache{$qacontact} ||= Bugzilla::User->new($qacontact);
my $qa_user = $usercache{$qacontact}; my $qa_user = $usercache{$qacontact};
foreach my $product_id (@newprod_ids) { foreach my $product_id (@newprod_ids) {
...@@ -992,7 +994,9 @@ SWITCH: for ($cgi->param('knob')) { ...@@ -992,7 +994,9 @@ SWITCH: for ($cgi->param('knob')) {
/^accept$/ && CheckonComment( "accept" ) && do { /^accept$/ && CheckonComment( "accept" ) && do {
DoConfirm(); DoConfirm();
ChangeStatus('ASSIGNED'); ChangeStatus('ASSIGNED');
if (Param("usetargetmilestone") && Param("musthavemilestoneonaccept")) { if (Bugzilla->params->{"usetargetmilestone"}
&& Bugzilla->params->{"musthavemilestoneonaccept"})
{
$requiremilestone = 1; $requiremilestone = 1;
} }
last SWITCH; last SWITCH;
...@@ -1007,7 +1011,7 @@ SWITCH: for ($cgi->param('knob')) { ...@@ -1007,7 +1011,7 @@ SWITCH: for ($cgi->param('knob')) {
Bugzilla::Bug->settable_resolutions); Bugzilla::Bug->settable_resolutions);
# don't resolve as fixed while still unresolved blocking bugs # don't resolve as fixed while still unresolved blocking bugs
if (Param("noresolveonopenblockers") if (Bugzilla->params->{"noresolveonopenblockers"}
&& $cgi->param('resolution') eq 'FIXED') && $cgi->param('resolution') eq 'FIXED')
{ {
my @dependencies = Bugzilla::Bug::CountOpenDependencies(@idlist); my @dependencies = Bugzilla::Bug::CountOpenDependencies(@idlist);
...@@ -1038,7 +1042,7 @@ SWITCH: for ($cgi->param('knob')) { ...@@ -1038,7 +1042,7 @@ SWITCH: for ($cgi->param('knob')) {
if (defined $cgi->param('assigned_to') if (defined $cgi->param('assigned_to')
&& trim($cgi->param('assigned_to')) ne "") { && trim($cgi->param('assigned_to')) ne "") {
$assignee = login_to_id(trim($cgi->param('assigned_to')), THROW_ERROR); $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); $usercache{$assignee} ||= Bugzilla::User->new($assignee);
my $assign_user = $usercache{$assignee}; my $assign_user = $usercache{$assignee};
foreach my $product_id (@newprod_ids) { foreach my $product_id (@newprod_ids) {
...@@ -1177,7 +1181,7 @@ if ($::comma eq "" ...@@ -1177,7 +1181,7 @@ if ($::comma eq ""
} }
# Process data for Time Tracking fields # Process data for Time Tracking fields
if (UserInGroup(Param('timetrackinggroup'))) { if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) {
foreach my $field ("estimated_time", "remaining_time") { foreach my $field ("estimated_time", "remaining_time") {
if (defined $cgi->param($field)) { if (defined $cgi->param($field)) {
my $er_time = trim($cgi->param($field)); my $er_time = trim($cgi->param($field));
...@@ -1249,7 +1253,7 @@ sub LogDependencyActivity { ...@@ -1249,7 +1253,7 @@ sub LogDependencyActivity {
return 0; return 0;
} }
if (Param("strict_isolation")) { if (Bugzilla->params->{"strict_isolation"}) {
my @blocked_cc = (); my @blocked_cc = ();
foreach my $pid (keys %cc_add) { foreach my $pid (keys %cc_add) {
$usercache{$pid} ||= Bugzilla::User->new($pid); $usercache{$pid} ||= Bugzilla::User->new($pid);
...@@ -1268,7 +1272,7 @@ if (Param("strict_isolation")) { ...@@ -1268,7 +1272,7 @@ if (Param("strict_isolation")) {
} }
} }
if ($prod_changed && Param("strict_isolation")) { if ($prod_changed && Bugzilla->params->{"strict_isolation"}) {
my $sth_cc = $dbh->prepare("SELECT who my $sth_cc = $dbh->prepare("SELECT who
FROM cc FROM cc
WHERE bug_id = ?"); WHERE bug_id = ?");
...@@ -1339,7 +1343,7 @@ foreach my $id (@idlist) { ...@@ -1339,7 +1343,7 @@ foreach my $id (@idlist) {
undef, $new_comp_id); undef, $new_comp_id);
$query .= ", assigned_to = ?"; $query .= ", assigned_to = ?";
push(@bug_values, $assignee); push(@bug_values, $assignee);
if (Param("useqacontact")) { if (Bugzilla->params->{"useqacontact"}) {
$qacontact = $dbh->selectrow_array('SELECT initialqacontact $qacontact = $dbh->selectrow_array('SELECT initialqacontact
FROM components FROM components
WHERE components.id = ?', WHERE components.id = ?',
...@@ -1396,7 +1400,7 @@ foreach my $id (@idlist) { ...@@ -1396,7 +1400,7 @@ foreach my $id (@idlist) {
# email addresses into their corresponding IDs; # email addresses into their corresponding IDs;
# - update $newhash{'bug_status'} to its real state if the bug # - update $newhash{'bug_status'} to its real state if the bug
# is in the unconfirmed state. # 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' if ($cgi->param('knob') eq 'reassignbycomponent'
|| $cgi->param('knob') eq 'reassign') { || $cgi->param('knob') eq 'reassign') {
$formhash{'assigned_to'} = $assignee; $formhash{'assigned_to'} = $assignee;
...@@ -1519,7 +1523,7 @@ foreach my $id (@idlist) { ...@@ -1519,7 +1523,7 @@ foreach my $id (@idlist) {
$timestamp = $dbh->selectrow_array(q{SELECT NOW()}); $timestamp = $dbh->selectrow_array(q{SELECT NOW()});
my $work_time; my $work_time;
if (UserInGroup(Param('timetrackinggroup'))) { if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) {
$work_time = $cgi->param('work_time'); $work_time = $cgi->param('work_time');
if ($work_time) { if ($work_time) {
# AppendComment (called below) can in theory raise an error, # AppendComment (called below) can in theory raise an error,
......
...@@ -187,7 +187,7 @@ if (!PrefillForm($buffer)) { ...@@ -187,7 +187,7 @@ if (!PrefillForm($buffer)) {
if ($userdefaultquery) { if ($userdefaultquery) {
PrefillForm($userdefaultquery); PrefillForm($userdefaultquery);
} else { } else {
PrefillForm(Param("defaultquery")); PrefillForm(Bugzilla->params->{"defaultquery"});
} }
} }
...@@ -218,7 +218,7 @@ my @milestones = sort(keys %milestones); ...@@ -218,7 +218,7 @@ my @milestones = sort(keys %milestones);
$vars->{'product'} = \@selectable_products; $vars->{'product'} = \@selectable_products;
# Create data structures representing each classification # Create data structures representing each classification
if (Param('useclassification')) { if (Bugzilla->params->{'useclassification'}) {
$vars->{'classification'} = $user->get_selectable_classifications; $vars->{'classification'} = $user->get_selectable_classifications;
} }
...@@ -227,7 +227,7 @@ $vars->{'component_'} = \@components; ...@@ -227,7 +227,7 @@ $vars->{'component_'} = \@components;
$vars->{'version'} = \@versions; $vars->{'version'} = \@versions;
if (Param('usetargetmilestone')) { if (Bugzilla->params->{'usetargetmilestone'}) {
$vars->{'target_milestone'} = \@milestones; $vars->{'target_milestone'} = \@milestones;
} }
...@@ -255,7 +255,7 @@ foreach my $val (editable_bug_fields()) { ...@@ -255,7 +255,7 @@ foreach my $val (editable_bug_fields()) {
push @chfields, $val; push @chfields, $val;
} }
if (UserInGroup(Param('timetrackinggroup'))) { if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) {
push @chfields, "work_time"; push @chfields, "work_time";
} else { } else {
@chfields = grep($_ ne "estimated_time", @chfields); @chfields = grep($_ ne "estimated_time", @chfields);
......
...@@ -72,12 +72,12 @@ if ($action eq "show") { ...@@ -72,12 +72,12 @@ if ($action eq "show") {
} }
if ($action eq "add") { if ($action eq "add") {
(Param('quip_list_entry_control') eq "closed") && (Bugzilla->params->{'quip_list_entry_control'} eq "closed") &&
ThrowUserError("no_new_quips"); ThrowUserError("no_new_quips");
# Add the quip # Add the quip
my $approved = my $approved = (Bugzilla->params->{'quip_list_entry_control'} eq "open")
(Param('quip_list_entry_control') eq "open") || (UserInGroup('admin')) || 0; || UserInGroup('admin') || 0;
my $comment = $cgi->param("quip"); my $comment = $cgi->param("quip");
$comment || ThrowUserError("need_quip"); $comment || ThrowUserError("need_quip");
trick_taint($comment); # Used in a placeholder below trick_taint($comment); # Used in a placeholder below
......
...@@ -80,7 +80,9 @@ sub queue { ...@@ -80,7 +80,9 @@ sub queue {
my $form_group = validateGroup($cgi->param('group')); my $form_group = validateGroup($cgi->param('group'));
my $attach_join_clause = "flags.attach_id = attachments.attach_id"; 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"; $attach_join_clause .= " AND attachments.isprivate < 1";
} }
...@@ -131,7 +133,7 @@ sub queue { ...@@ -131,7 +133,7 @@ sub queue {
(ccmap.who IS NOT NULL AND cclist_accessible = 1) OR (ccmap.who IS NOT NULL AND cclist_accessible = 1) OR
(bugs.reporter = $userid AND bugs.reporter_accessible = 1) OR (bugs.reporter = $userid AND bugs.reporter_accessible = 1) OR
(bugs.assigned_to = $userid) " . (bugs.assigned_to = $userid) " .
(Param('useqacontact') ? "OR (Bugzilla->params->{'useqacontact'} ? "OR
(bugs.qa_contact = $userid))" : ")"); (bugs.qa_contact = $userid))" : ")");
# Limit query to pending requests. # Limit query to pending requests.
......
...@@ -114,7 +114,7 @@ if ($cgi->param("field")) { ...@@ -114,7 +114,7 @@ if ($cgi->param("field")) {
@fieldlist = $cgi->param("field"); @fieldlist = $cgi->param("field");
} }
unless (UserInGroup(Param("timetrackinggroup"))) { unless (UserInGroup(Bugzilla->params->{"timetrackinggroup"})) {
@fieldlist = grep($_ !~ /_time$/, @fieldlist); @fieldlist = grep($_ !~ /_time$/, @fieldlist);
} }
......
...@@ -110,7 +110,7 @@ if (!defined $cgi->param('id') && !defined $cgi->param('doall')) { ...@@ -110,7 +110,7 @@ if (!defined $cgi->param('id') && !defined $cgi->param('doall')) {
my ($fh, $filename) = File::Temp::tempfile("XXXXXXXXXX", my ($fh, $filename) = File::Temp::tempfile("XXXXXXXXXX",
SUFFIX => '.dot', SUFFIX => '.dot',
DIR => $webdotdir); DIR => $webdotdir);
my $urlbase = Param('urlbase'); my $urlbase = Bugzilla->params->{'urlbase'};
print $fh "digraph G {"; print $fh "digraph G {";
print $fh qq{ print $fh qq{
...@@ -218,7 +218,7 @@ close $fh; ...@@ -218,7 +218,7 @@ close $fh;
chmod 0777, $filename; chmod 0777, $filename;
my $webdotbase = Param('webdotbase'); my $webdotbase = Bugzilla->params->{'webdotbase'};
if ($webdotbase =~ /^https?:/) { if ($webdotbase =~ /^https?:/) {
# Remote dot server # Remote dot server
......
...@@ -405,7 +405,7 @@ my $cgi = Bugzilla->cgi; ...@@ -405,7 +405,7 @@ my $cgi = Bugzilla->cgi;
Bugzilla->switch_to_shadow_db(); Bugzilla->switch_to_shadow_db();
UserInGroup(Param("timetrackinggroup")) UserInGroup(Bugzilla->params->{"timetrackinggroup"})
|| ThrowUserError("auth_failure", {group => "time-tracking", || ThrowUserError("auth_failure", {group => "time-tracking",
action => "access", action => "access",
object => "timetracking_summaries"}); object => "timetracking_summaries"});
......
...@@ -50,7 +50,7 @@ sub DoAccount { ...@@ -50,7 +50,7 @@ sub DoAccount {
($vars->{'realname'}) = $dbh->selectrow_array( ($vars->{'realname'}) = $dbh->selectrow_array(
"SELECT realname FROM profiles WHERE userid = ?", undef, $user->id); "SELECT realname FROM profiles WHERE userid = ?", undef, $user->id);
if(Param('allowemailchange') if(Bugzilla->params->{'allowemailchange'}
&& Bugzilla->user->authorizer->can_change_email) { && Bugzilla->user->authorizer->can_change_email) {
my @token = $dbh->selectrow_array( my @token = $dbh->selectrow_array(
"SELECT tokentype, issuedate + " . "SELECT tokentype, issuedate + " .
...@@ -113,7 +113,7 @@ sub SaveAccount { ...@@ -113,7 +113,7 @@ sub SaveAccount {
} }
} }
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 $old_login_name = $cgi->param('Bugzilla_login');
my $new_login_name = trim($cgi->param('new_login_name')); my $new_login_name = trim($cgi->param('new_login_name'));
...@@ -200,7 +200,7 @@ sub DoEmail { ...@@ -200,7 +200,7 @@ sub DoEmail {
########################################################################### ###########################################################################
# User watching # User watching
########################################################################### ###########################################################################
if (Param("supportwatchers")) { if (Bugzilla->params->{"supportwatchers"}) {
my $watched_ref = $dbh->selectcol_arrayref( my $watched_ref = $dbh->selectcol_arrayref(
"SELECT profiles.login_name FROM watch INNER JOIN profiles" . "SELECT profiles.login_name FROM watch INNER JOIN profiles" .
" ON watch.watched = profiles.userid" . " ON watch.watched = profiles.userid" .
...@@ -298,7 +298,9 @@ sub SaveEmail { ...@@ -298,7 +298,9 @@ sub SaveEmail {
########################################################################### ###########################################################################
# User watching # 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: # Just in case. Note that this much locking is actually overkill:
# we don't really care if anyone reads the watch table. So # we don't really care if anyone reads the watch table. So
# some small amount of contention could be gotten rid of by # some small amount of contention could be gotten rid of by
......
...@@ -82,7 +82,7 @@ elsif ($action eq "show_user") { ...@@ -82,7 +82,7 @@ elsif ($action eq "show_user") {
show_user(); show_user();
} }
elsif ($action eq "vote") { elsif ($action eq "vote") {
record_votes() if Param('usevotes'); record_votes() if Bugzilla->params->{'usevotes'};
show_user(); show_user();
} }
else { else {
...@@ -126,7 +126,7 @@ sub show_user { ...@@ -126,7 +126,7 @@ sub show_user {
my $who = login_to_id($name, THROW_ERROR); my $who = login_to_id($name, THROW_ERROR);
my $userid = $user->id; 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', $dbh->bz_lock_tables('bugs READ', 'products READ', 'votes WRITE',
'cc READ', 'bug_group_map READ', 'user_group_map READ', 'cc READ', 'bug_group_map READ', 'user_group_map READ',
......
...@@ -96,9 +96,9 @@ my $sth_schedules_by_event = $dbh->prepare( ...@@ -96,9 +96,9 @@ my $sth_schedules_by_event = $dbh->prepare(
# Send whines from the address in the 'maintainer' Parameter so that all # Send whines from the address in the 'maintainer' Parameter so that all
# Bugzilla-originated mail appears to come from a single address. # 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. " . die "Cannot run. " .
"The maintainer email address has not been properly set!\n"; "The maintainer email address has not been properly set!\n";
} }
......
...@@ -36,7 +36,7 @@ use Bugzilla::Mailer; ...@@ -36,7 +36,7 @@ use Bugzilla::Mailer;
use Bugzilla::Util; use Bugzilla::Util;
# Whining is disabled if whinedays is zero # Whining is disabled if whinedays is zero
exit unless Param('whinedays') >= 1; exit unless Bugzilla->params->{'whinedays'} >= 1;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $query = q{SELECT bug_id, short_desc, login_name my $query = q{SELECT bug_id, short_desc, login_name
...@@ -46,7 +46,7 @@ my $query = q{SELECT bug_id, short_desc, login_name ...@@ -46,7 +46,7 @@ my $query = q{SELECT bug_id, short_desc, login_name
WHERE (bug_status = ? OR bug_status = ?) WHERE (bug_status = ? OR bug_status = ?)
AND } . $dbh->sql_to_days('NOW()') . " - " . AND } . $dbh->sql_to_days('NOW()') . " - " .
$dbh->sql_to_days('delta_ts') . " > " . $dbh->sql_to_days('delta_ts') . " > " .
Param('whinedays') . Bugzilla->params->{'whinedays'} .
" ORDER BY bug_id"; " ORDER BY bug_id";
my %bugs; my %bugs;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment