]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 342869: Use Bugzilla->params everywhere except templates
authormkanat%bugzilla.org <>
Tue, 4 Jul 2006 04:26:20 +0000 (04:26 +0000)
committermkanat%bugzilla.org <>
Tue, 4 Jul 2006 04:26:20 +0000 (04:26 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=justdave

53 files changed:
Bugzilla/Attachment.pm
Bugzilla/Auth.pm
Bugzilla/Auth/Login/CGI.pm
Bugzilla/Auth/Login/Env.pm
Bugzilla/Auth/Persist/Cookie.pm
Bugzilla/Auth/Verify/LDAP.pm
Bugzilla/Bug.pm
Bugzilla/BugMail.pm
Bugzilla/Config.pm
Bugzilla/DB.pm
Bugzilla/Flag.pm
Bugzilla/FlagType.pm
Bugzilla/Mailer.pm
Bugzilla/Search.pm
Bugzilla/Search/Quicksearch.pm
Bugzilla/Template.pm
Bugzilla/Template/Plugin/Hook.pm
Bugzilla/Token.pm
Bugzilla/User.pm
attachment.cgi
buglist.cgi
chart.cgi
checksetup.pl
colchange.cgi
config.cgi
contrib/bug_email.pl
contrib/sendbugmail.pl
contrib/syncLDAP.pl
createaccount.cgi
duplicates.cgi
editclassifications.cgi
editcomponents.cgi
editgroups.cgi
editparams.cgi
editproducts.cgi
editusers.cgi
editvalues.cgi
editwhines.cgi
enter_bug.cgi
importxml.pl
index.cgi
post_bug.cgi
process_bug.cgi
query.cgi
quips.cgi
request.cgi
show_bug.cgi
showdependencygraph.cgi
summarize_time.cgi
userprefs.cgi
votes.cgi
whine.pl
whineatnews.pl

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