]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 282121: Remove globals.pl from scripts that no longer use it - Patch by Frédéric...
authorlpsolit%gmail.com <>
Wed, 21 Jun 2006 07:44:46 +0000 (07:44 +0000)
committerlpsolit%gmail.com <>
Wed, 21 Jun 2006 07:44:46 +0000 (07:44 +0000)
62 files changed:
Bugzilla/Attachment.pm
Bugzilla/Config.pm
Bugzilla/Token.pm
attachment.cgi
buglist.cgi
chart.cgi
checksetup.pl
colchange.cgi
collectstats.pl
config.cgi
contrib/BugzillaEmail.pm
contrib/bug_email.pl
contrib/bugzilla_email_append.pl
contrib/gnats2bz.pl
contrib/sendbugmail.pl
contrib/sendunsentbugmail.pl
contrib/syncLDAP.pl
createaccount.cgi
customfield.pl
describecomponents.cgi
describekeywords.cgi
duplicates.cgi
editclassifications.cgi
editcomponents.cgi
editflagtypes.cgi
editgroups.cgi
editkeywords.cgi
editmilestones.cgi
editparams.cgi
editproducts.cgi
editsettings.cgi
editusers.cgi
editvalues.cgi
editversions.cgi
editwhines.cgi
enter_bug.cgi
globals.pl [deleted file]
importxml.pl
index.cgi
page.cgi
post_bug.cgi
process_bug.cgi
query.cgi
quips.cgi
relogin.cgi
report.cgi
reports.cgi
request.cgi
sanitycheck.cgi
show_activity.cgi
show_bug.cgi
showdependencygraph.cgi
showdependencytree.cgi
sidebar.cgi
summarize_time.cgi
t/004template.t
testserver.pl
token.cgi
userprefs.cgi
votes.cgi
whine.pl
whineatnews.pl

index 40231aa6cf857552880691ae402b7db6961c308a..a7961d764874eb2c6eaac8956776d767bbc7c8e6 100644 (file)
@@ -47,9 +47,6 @@ that users upload to the Bugzilla server.
 
 =cut
 
-# This module requires that its caller have said "require globals.pl"
-# to import relevant functions from that script.
-
 use Bugzilla::Error;
 use Bugzilla::Flag;
 use Bugzilla::Config qw(:locations Param);
index 3f5b788c2edc47ef6fe0a0fe2c0be7f5336a6bfa..cb20fad242a794501b95b4ef299bf528bc2dedaa 100644 (file)
@@ -79,19 +79,16 @@ our @parampanels = ();
 # Don't export localvars by default - people should have to explicitly
 # ask for it, as a (probably futile) attempt to stop code using it
 # when it shouldn't
-# ChmodDataFile is here until that stuff all moves out of globals.pl
-# into this file
-@Bugzilla::Config::EXPORT_OK = qw(ChmodDataFile);
-
 %Bugzilla::Config::EXPORT_TAGS =
   (
    admin => [qw(UpdateParams SetParam WriteParams)],
    db => [qw($db_driver $db_host $db_port $db_name $db_user $db_pass $db_sock)],
+   localconfig => [qw($cvsbin $interdiffbin $diffpath $webservergroup)],
    locations => [qw($libpath $localconfig $attachdir $datadir $templatedir
                     $webdotdir $project $extensionsdir)],
    params => [qw(@parampanels)],
   );
-Exporter::export_ok_tags('admin', 'db', 'locations', 'params');
+Exporter::export_ok_tags('admin', 'db', 'localconfig', 'locations', 'params');
 
 # Bugzilla version
 $Bugzilla::Config::VERSION = "2.23.1+";
index 3cb4d6ffc7efc8eaa9754fbd7d10f182c4c1af4a..40eef4f1b5a825366a81c4bdc4b2fb33943389a3 100644 (file)
@@ -37,9 +37,6 @@ use Bugzilla::Util;
 use Date::Format;
 use Date::Parse;
 
-# This module requires that its caller have said "require globals.pl" to import
-# relevant functions from that script.
-
 ################################################################################
 # Constants
 ################################################################################
index c79ebf2cb0c1d183f765b3e5af2ed273d66ed6f6..7acc6e32604503d427fba673302dfa3eacdbcc99 100755 (executable)
@@ -37,12 +37,10 @@ use strict;
 
 use lib qw(.);
 
-# Include the Bugzilla CGI and general utility library.
-require "globals.pl";
-
 use Bugzilla;
-use Bugzilla::Config qw(:locations);
+use Bugzilla::Config qw(:DEFAULT :localconfig);
 use Bugzilla::Constants;
+use Bugzilla::Error;
 use Bugzilla::Flag; 
 use Bugzilla::FlagType; 
 use Bugzilla::User;
@@ -371,7 +369,7 @@ sub view
     {
         my $hash = ($attach_id % 100) + 100;
         $hash =~ s/.*(\d\d)$/group.$1/;
-        if (open(AH, "$attachdir/$hash/attachment.$attach_id")) {
+        if (open(AH, bz_locations()->{'attachdir'} . "/$hash/attachment.$attach_id")) {
             binmode AH;
             $filesize = (stat(AH))[7];
         }
@@ -424,8 +422,8 @@ sub interdiff
   #
   # Must hack path so that interdiff will work.
   #
-  $ENV{'PATH'} = $::diffpath;
-  open my $interdiff_fh, "$::interdiffbin $old_filename $new_filename|";
+  $ENV{'PATH'} = $diffpath;
+  open my $interdiff_fh, "$interdiffbin $old_filename $new_filename|";
   binmode $interdiff_fh;
     my ($reader, $last_reader) = setup_patch_readers("", $context);
     if ($format eq 'raw')
@@ -558,7 +556,7 @@ sub setup_patch_readers {
     $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 && Param('cvsroot_get'))
   {
     require PatchReader::AddCVSContext;
     $last_reader->sends_data_to(
@@ -583,7 +581,7 @@ 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 && Param('cvsroot_get') && !$vars->{'newid'};
 
   # Print everything out
   print $cgi->header(-type => 'text/html',
@@ -634,7 +632,7 @@ sub diff
   else
   {
     $vars->{other_patches} = [];
-    if ($::interdiffbin && $::diffpath) {
+    if ($interdiffbin && $diffpath) {
       # Get list of attachments on this bug.
       # Ignore the current patch, but select the one right before it
       # chronologically.
index 5d56c2255703bc450f289b434a5012d31ef6d525..cb9dba6632e6f1c4cc1eecf22224d76b27e01fb8 100755 (executable)
@@ -35,9 +35,12 @@ use strict;
 use lib qw(.);
 
 use Bugzilla;
+use Bugzilla::Constants;
+use Bugzilla::Error;
+use Bugzilla::Util;
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::Search;
 use Bugzilla::Search::Quicksearch;
-use Bugzilla::Constants;
 use Bugzilla::User;
 use Bugzilla::Bug;
 use Bugzilla::Product;
@@ -46,9 +49,6 @@ use Bugzilla::Field;
 
 use Date::Parse;
 
-# Include the Bugzilla CGI and general utility library.
-require "globals.pl";
-
 my $cgi = Bugzilla->cgi;
 my $dbh = Bugzilla->dbh;
 my $template = Bugzilla->template;
@@ -894,7 +894,7 @@ if ($serverpush) {
 # query performance.
 $dbh = Bugzilla->switch_to_shadow_db();
 
-# Normally, we ignore SIGTERM and SIGPIPE (see globals.pl) but we need to
+# Normally, we ignore SIGTERM and SIGPIPE, but we need to
 # respond to them here to prevent someone DOSing us by reloading a query
 # a large number of times.
 $::SIG{TERM} = 'DEFAULT';
index c60eedac49f75f03d7e107f8e5d99fc1afb106c6..4bd83cc50d0fdcce358bea7aa0a30d7a76faa367 100755 (executable)
--- a/chart.cgi
+++ b/chart.cgi
 use strict;
 use lib qw(.);
 
-require "globals.pl";
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Error;
+use Bugzilla::Util;
 use Bugzilla::Chart;
 use Bugzilla::Series;
 use Bugzilla::User;
index ff51aacf9ed44fbe7dfce48d1624722cccca6035..f77f0dba6a0a89998f3a4bb14a0eca28a6287f18 100755 (executable)
@@ -1048,11 +1048,6 @@ while (my ($table, $values) = each %$enum_values) {
 # Create initial --DATA-- directory and make the initial empty files there:
 #
 
-# The |require "globals.pl"| above ends up creating a template object with
-# a COMPILE_DIR of "$datadir". This means that TT creates the directory for us,
-# so this code wouldn't run if we just checked for the existence of the
-# directory. Instead, check for the existence of '$datadir/nomail', which is
-# created in this block
 unless (-d $datadir && -e "$datadir/nomail") {
     print "Creating data directory ($datadir) ...\n";
     # permissions for non-webservergroup are fixed later on
@@ -1596,8 +1591,7 @@ if ($^O !~ /MSWin32/i) {
         fixPerms('css', $<, $webservergid, 027, 1);
         fixPerms('skins', $<, $webservergid, 027, 1);
         fixPerms('js', $<, $webservergid, 027, 1);
-        chmod 0644, 'globals.pl';
-        
+
         # Don't use fixPerms here, because it won't change perms 
         # on the directory unless it's using recursion
         chown $<, $webservergid, $datadir;
index cf9e14977a553918ce9449b3342b57a8095394f9..857b8506334d4d126df9a294e6748936c2a27f85 100755 (executable)
@@ -27,9 +27,10 @@ use lib qw(.);
 
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Error;
 use Bugzilla::User;
 use Bugzilla::Keyword;
-require "globals.pl";
 
 Bugzilla->login();
 
index ca37c0b3cec1badbcfe65bcd3eead6c9829a8348..2f76e544f3f122bedfa344ad1564e9db8629c1a7 100755 (executable)
@@ -34,9 +34,11 @@ use strict;
 use IO::Handle;
 
 use lib ".";
-require "globals.pl";
+
 use Bugzilla;
-use Bugzilla::Config qw(:DEFAULT $datadir);
+use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
 use Bugzilla::Search;
 use Bugzilla::User;
 use Bugzilla::Product;
@@ -63,6 +65,8 @@ if ($#ARGV >= 0 && $ARGV[0] eq "--regenerate") {
     $regenerate = 1;
 }
 
+my $datadir = bz_locations()->{'datadir'};
+
 my @myproducts = map {$_->name} Bugzilla::Product::get_all_products();
 unshift(@myproducts, "-All-");
 
@@ -71,7 +75,7 @@ foreach (@myproducts) {
     my $dir = "$datadir/mining";
 
     &check_data_dir ($dir);
-    
+
     if ($regenerate) {
         &regenerate_stats($dir, $_);
     } else {
@@ -206,6 +210,8 @@ sub calculate_dupes {
     # Save % count here in a date-named file
     # so we can read it back in to do changed counters
     # First, delete it if it exists, so we don't add to the contents of an old file
+    my $datadir = bz_locations()->{'datadir'};
+
     if (my @files = <$datadir/duplicates/dupes$today*>) {
         map { trick_taint($_) } @files;
         unlink @files;
index 6ed57bd855c302d569e23ed71175fe22d55a898f..a50f3aaf629003f1de747b2dbfd1a8a8b62e2216 100755 (executable)
 # Make it harder for us to do dangerous things in Perl.
 use strict;
 
-# Include the Bugzilla CGI and general utility library.
 use lib qw(.);
-require "globals.pl";
+
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Error;
 use Bugzilla::Keyword;
 use Bugzilla::Bug;
 use Bugzilla::Field;
index be51489a5bc0210025af8e5dba80bc268ee9a1aa..c6b569c9d2594c40b94192e063fb6a07286af903 100644 (file)
 
 push @INC, "../."; # this script now lives in contrib
 
-require "globals.pl";
-
 use strict;
 
+use Bugzilla;
 
 my $EMAIL_TRANSFORM_NONE = "email_transform_none";
 my $EMAIL_TRANSFORM_BASE_DOMAIN = "email_transform_base_domain";
index 546c08dc562e94853112106f10322ad85aabf436..5f95e92729496f041f991764f6f88622108c25eb 100755 (executable)
@@ -38,7 +38,7 @@
 #
 # You need to work with bug_email.pl the MIME::Parser installed.
 # 
-# $Id: bug_email.pl,v 1.41 2006/06/19 17:30:24 lpsolit%gmail.com Exp $
+# $Id: bug_email.pl,v 1.42 2006/06/21 00:44:48 lpsolit%gmail.com Exp $
 ###############################################################
 
 # 02/12/2000 (SML)
@@ -73,7 +73,7 @@
 # - querying a bug over email
 # - appending a bug over email
 # - keywords over email
-# - use the globals.pl parameters functionality to edit and save this script's parameters
+# - use the Bugzilla parameters functionality to edit and save this script's parameters
 # - integrate some setup in the checksetup.pl script
 # - gpg signatures for security
 
@@ -86,14 +86,14 @@ BEGIN {
     push @INC, ".";
 }
 
-require "globals.pl";
-use Bugzilla;
-use BugzillaEmail;
-use Bugzilla::Config qw(:DEFAULT $datadir);
-
 use lib ".";
 use lib "../";
+
+use Bugzilla;
+use BugzillaEmail;
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::Constants;
+use Bugzilla::Util;
 use Bugzilla::BugMail;
 use Bugzilla::User;
 use Bugzilla::Product;
@@ -228,7 +228,7 @@ sub Reply( $$$$ ) {
     die "Cannot find sender-email-address" unless defined( $Sender );
     
     if( $test ) {
-        open( MAIL, '>>', "$datadir/bug_email_test.log" );
+        open( MAIL, '>>', bz_locations()->{'datadir'} . "/bug_email_test.log" );
     }
     else {
         open( MAIL, "| /usr/sbin/sendmail -t" );
@@ -669,6 +669,7 @@ my $parser = new MIME::Parser;
 
 # Create and set the output directory:
 # FIXME: There should be a $BUGZILLA_HOME variable (SML)
+my $datadir = bz_locations()->{'datadir'};
 (-d "$datadir/mimedump-tmp") or mkdir "$datadir/mimedump-tmp",0755 or die "mkdir: $!";
 (-w "$datadir/mimedump-tmp") or die "can't write to directory";
 
index cf144642d8d4f5ce5d45b51a773efa90db7e41d7..fef46f01b6975797df0d6187eb48c69a4b186538 100755 (executable)
@@ -37,10 +37,10 @@ BEGIN {
   push @INC, "."; # this script lives in contrib
 }
 
-require "globals.pl";
 use Bugzilla;
+use Bugzilla::Constants;
 use BugzillaEmail;
-use Bugzilla::Config qw(:DEFAULT $datadir);
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::BugMail;
 
 my $dbh = Bugzilla->dbh;
@@ -52,6 +52,7 @@ my $Comment = "";
 
 # Create and set the output directory:
 # FIXME: There should be a $BUGZILLA_HOME variable (SML)
+my $datadir = bz_locations()->{'datadir'};
 (-d "$datadir/mimedump-tmp") or mkdir "$datadir/mimedump-tmp",0755 or die "mkdir: $!";
 (-w "$datadir/mimedump-tmp") or die "can't write to directory";
 
@@ -153,45 +154,45 @@ sub dump_entity {
     # Output the body:
     my @parts = $entity->parts;
     if (@parts) {                     # multipart...
-       my $i;
-       foreach $i (0 .. $#parts) {       # dump each part...
-           dump_entity($parts[$i], ("$name, part ".(1+$i)));
-       }
-    } else {                            # single part...       
-
-       # Get MIME type, and display accordingly...
-       my $msg_part = $entity->head->get( 'Content-Disposition' );
-       
-       $msg_part ||= ""; 
-
-       my ($type, $subtype) = split('/', $entity->head->mime_type);
-       my $body = $entity->bodyhandle;
-       my ($data, $on_disk );
-
-       if(  $msg_part =~ /^attachment/ ) {
-           # Attached File
-           my $des = $entity->head->get('Content-Description');
-           $des ||= "";
-
-           if( defined( $body->path )) { # Data is on disk
-               $on_disk = 1;
-               $data = $body->path;
-               
-           } else {                      # Data is in core
-               $on_disk = 0;
-               $data = $body->as_string;
-           }
-#          push ( @attachments, [ $data, $entity->head->mime_type, $on_disk, $des ] );
-       } else {
-           # Real Message
-           if ($type =~ /^(text|message)$/) {     # text: display it...
-               if ($IO = $body->open("r")) {
-                   $Comment .=  $_ while (defined($_ = $IO->getline));
-                   $IO->close;
-               } else {       # d'oh!
-                   print "$0: couldn't find/open '$name': $!";
-               }
-           } else { print "Oooops - no Body !\n"; }
-       }
+        my $i;
+        foreach $i (0 .. $#parts) {       # dump each part...
+            dump_entity($parts[$i], ("$name, part ".(1+$i)));
+        }
+    } else {                            # single part...        
+
+        # Get MIME type, and display accordingly...
+        my $msg_part = $entity->head->get( 'Content-Disposition' );
+        
+        $msg_part ||= ""; 
+
+        my ($type, $subtype) = split('/', $entity->head->mime_type);
+        my $body = $entity->bodyhandle;
+        my ($data, $on_disk );
+
+        if(  $msg_part =~ /^attachment/ ) {
+            # Attached File
+            my $des = $entity->head->get('Content-Description');
+            $des ||= "";
+
+            if( defined( $body->path )) { # Data is on disk
+                $on_disk = 1;
+                $data = $body->path;
+                
+            } else {                      # Data is in core
+                $on_disk = 0;
+                $data = $body->as_string;
+            }
+#           push ( @attachments, [ $data, $entity->head->mime_type, $on_disk, $des ] );
+        } else {
+            # Real Message
+            if ($type =~ /^(text|message)$/) {     # text: display it...
+                if ($IO = $body->open("r")) {
+                    $Comment .=  $_ while (defined($_ = $IO->getline));
+                    $IO->close;
+                } else {       # d'oh!
+                    print "$0: couldn't find/open '$name': $!";
+                }
+            } else { print "Oooops - no Body !\n"; }
+        }
     }
 }
index c343f575033ce3e25d08c1dd4eb4f69bfd43fb3e..7a509682e15ec861e5db58cf26a16f10e6fafddc 100644 (file)
@@ -861,8 +861,6 @@ sub map_username_to_realname() {
     return("");
 }
 
-# This routine was copied from globals.pl which was largely copied
-# from Mysql.pm.
 sub detaint_string {
     my ($str) = @_;
     $str =~ m/^(.*)$/s;
index 5e7cda696b5c6e47ece27cdfe697571450385912..bcc01666cf65664ccea6ad96cc9035581fd5f940 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Nick Barnes, Ravenbrook Limited, 2004-04-01.
 #
-# $Id: sendbugmail.pl,v 1.4 2006/05/15 16:06:59 lpsolit%gmail.com Exp $
+# $Id: sendbugmail.pl,v 1.5 2006/06/21 00:44:48 lpsolit%gmail.com 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.
@@ -16,8 +16,9 @@
 
 use lib qw(.);
 
-require "globals.pl";
 use Bugzilla;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
 use Bugzilla::BugMail;
 use Bugzilla::User;
 
index 1fad9c891d4ae944f29c9850b50cade72e49b0cf..5ed49b22edef24cf789848910a6260fda453310f 100644 (file)
@@ -25,7 +25,6 @@ use strict;
 
 use lib qw(.);
 
-require "globals.pl";
 use Bugzilla;
 use Bugzilla::Constants;
 use Bugzilla::BugMail;
index 0622f8ab4948c32e20a4d7ba6b663b0caa3dd426..b3ca80705676246a5eea1efc693ab8263b58b6e8 100755 (executable)
 #
 # The Original Code is the LDAP to Bugzilla User Sync Tool.
 #
-# The Initial Developer of the Original Code is Andreas Höfler.
-# Portions created by Andreas Höfler are Copyright (C) 2003
-# Andreas Höfler. All
-# Rights Reserved.
+# The Initial Developer of the Original Code is Andreas Höfler.
+# Portions created by Andreas Höfler are Copyright (C) 2003
+# Andreas Höfler. All Rights Reserved.
 #
-# Contributor(s): Andreas Höfler <andreas.hoefler@bearingpoint.com>
+# Contributor(s): Andreas Höfler <andreas.hoefler@bearingpoint.com>
 #
 
 use strict;
 
-require "globals.pl";
-
 use lib qw(.);
 
 use Net::LDAP;
 use Bugzilla;
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::User;
 
 my $cgi = Bugzilla->cgi;
index b50f9d87ac400559b0891123b176fc1eef4a019d..980b5986ab6c2dab96b4a2695dd3f7bd611d31d1 100755 (executable)
@@ -28,10 +28,10 @@ use strict;
 
 use lib qw(.);
 
-require "globals.pl";
-
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Error;
 use Bugzilla::User;
 use Bugzilla::BugMail;
 use Bugzilla::Util;
index 101bac880a1e3d29881cc53a61d18e91f5af7354..2821425c7ece5bc0fc6e0a461ca86cc95549f30d 100755 (executable)
@@ -27,7 +27,6 @@
 use strict;
 
 use lib ".";
-require "globals.pl";
 
 use Bugzilla;
 use Bugzilla::Field;
index 87a1eed32a51bffaee91fc946217ba169e5a87dd..d42979d0ba15aeccf16a4af83bf2394c1f86e1fc 100755 (executable)
@@ -27,7 +27,8 @@ use lib qw(.);
 
 use Bugzilla;
 use Bugzilla::Constants;
-require "globals.pl";
+use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Product;
 
 my $user = Bugzilla->login();
index 2b21e712c7cc319e9cbc173bec46882756c08e0f..e06350d2e827ba700ae31e7c8da2120786a253fa 100755 (executable)
@@ -25,10 +25,9 @@ use strict;
 use lib ".";
 
 use Bugzilla;
+use Bugzilla::Error;
 use Bugzilla::User;
 
-require "globals.pl";
-
 Bugzilla->login();
 
 my $cgi = Bugzilla->cgi;
index 5264e1e14119e93be80a186a9a900ded9a2854ba..6b839165b0c46d56e626e512a08d06f7892a4b9e 100755 (executable)
@@ -29,12 +29,12 @@ use AnyDBM_File;
 
 use lib qw(.);
 
-require "globals.pl";
-
 use Bugzilla;
-use Bugzilla::Search;
-use Bugzilla::Config qw(:DEFAULT $datadir);
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
+use Bugzilla::Error;
+use Bugzilla::Search;
 use Bugzilla::Product;
 
 my $cgi = Bugzilla->cgi;
@@ -106,6 +106,8 @@ my $yesterday = days_ago(1);
 use Errno;
 use Fcntl;
 
+my $datadir = bz_locations()->{'datadir'};
+
 if (!tie(%dbmcount, 'AnyDBM_File', "$datadir/duplicates/dupes$today",
          O_RDONLY, 0644)) {
     if ($!{ENOENT}) {
index ce82ccb97d0cee3fe2f60770eabd198fd5d455ba..e23f32b7e53d6ac561997563c7223d05cb76c942 100755 (executable)
@@ -27,11 +27,9 @@ use Bugzilla;
 use Bugzilla::Constants;
 use Bugzilla::Util;
 use Bugzilla::Error;
-use Bugzilla::Config qw($datadir);
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::Classification;
 
-require "globals.pl";
-
 my $cgi = Bugzilla->cgi;
 my $dbh = Bugzilla->dbh;
 my $template = Bugzilla->template;
index e063c1b1088b950a8f76d544211f136446499cc1..225e7ae912ffa58b35b5dcf7e2ba6d3e2312f25f 100755 (executable)
 use strict;
 use lib ".";
 
-require "globals.pl";
-
 use Bugzilla;
 use Bugzilla::Constants;
-use Bugzilla::Config qw(:DEFAULT $datadir);
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::Series;
 use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::User;
 use Bugzilla::Product;
 use Bugzilla::Component;
index 0386fca06b0780bf3fa00954a236d84cda6aab33..825fa1eb567290a01fdb8997cd03b3fd4dea6eb6 100755 (executable)
@@ -29,9 +29,6 @@
 use strict;
 use lib ".";
 
-# Include the Bugzilla CGI and general utility library.
-require "globals.pl";
-
 # Use Bugzilla's flag modules for handling flag types.
 use Bugzilla;
 use Bugzilla::Constants;
@@ -39,6 +36,7 @@ use Bugzilla::Flag;
 use Bugzilla::FlagType;
 use Bugzilla::Group;
 use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Product;
 use Bugzilla::Component;
 use Bugzilla::Bug;
index 2b4671b146d80d3dc9cce0140c566790cd2e95a4..7bc712b685d7cd0a0035a1d1ce8c5678bbe185af 100755 (executable)
 #                 Vlad Dascalu <jocuri@softhome.net>
 #                 Frédéric Buclin <LpSolit@gmail.com>
 
-# Code derived from editowners.cgi and editusers.cgi
-
 use strict;
 use lib ".";
 
 use Bugzilla;
 use Bugzilla::Constants;
 use Bugzilla::Config qw(:DEFAULT :admin);
+use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Group;
 use Bugzilla::Product;
 use Bugzilla::User;
-require "globals.pl";
 
 my $cgi = Bugzilla->cgi;
 my $dbh = Bugzilla->dbh;
index b53aebb3e77e2f38e8242fefef29b5994485d1f0..9696480bd5fc7b4a26030442e61d55f3a73aa9fc 100755 (executable)
 use strict;
 use lib ".";
 
-require "globals.pl";
-
 use Bugzilla;
 use Bugzilla::Constants;
-use Bugzilla::Config qw(:DEFAULT $datadir);
+use Bugzilla::Util;
+use Bugzilla::Error;
 
 my $cgi = Bugzilla->cgi;
 my $dbh = Bugzilla->dbh;
index 8e2a6e3f40dbd6fb196edac539ff7dc79a26fdce..261b81920ad974d114ce0b9eb395be8c80f79b44 100755 (executable)
 # Matt Masson <matthew@zeroknowledge.com>
 #
 # Contributors : Gavin Shelley <bugzilla@chimpychompy.org>
-#                Frédéric Buclin <LpSolit@gmail.com>
+#                Frédéric Buclin <LpSolit@gmail.com>
 #
 
 
 use strict;
 use lib ".";
 
-require "globals.pl";
-
 use Bugzilla;
 use Bugzilla::Constants;
-use Bugzilla::Config qw(:DEFAULT $datadir);
+use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Product;
 use Bugzilla::Milestone;
 use Bugzilla::Bug;
index bb8fa591b884c8600ef1c2cda434739f50e98abd..61fc03811ded2cb3bd2e1ff35d3e54e88ea8f69d 100755 (executable)
@@ -27,10 +27,11 @@ use lib ".";
 
 use Bugzilla;
 use Bugzilla::Constants;
-use Bugzilla::Config qw(:DEFAULT :admin :params $datadir);
+use Bugzilla::Config qw(:DEFAULT :admin :params);
 use Bugzilla::Config::Common;
+use Bugzilla::Util;
+use Bugzilla::Error;
 
-require "globals.pl";
 use vars qw(@parampanels);
 
 my $user = Bugzilla->login(LOGIN_REQUIRED);
index 46b3a01454d699816df4e7189db695605ba30532..a3c5221b565cca5030ccc95ec9b1c548f0aa1f42 100755 (executable)
 
 use strict;
 use lib ".";
+
 use Bugzilla;
 use Bugzilla::Constants;
-require "globals.pl";
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Bug;
 use Bugzilla::Series;
-use Bugzilla::Config qw(:DEFAULT $datadir);
 use Bugzilla::Mailer;
 use Bugzilla::Product;
 use Bugzilla::Classification;
index 231c1aea8c2b5802373bcddba5cb6cc6c49e121e..85332a39ac1254b87573dd3228b8339cbc0ea114 100755 (executable)
@@ -21,10 +21,10 @@ use lib qw(.);
 
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::User::Setting;
 
-require "globals.pl";
-
 my $template = Bugzilla->template;
 my $vars = {};
 
index 6da000a1ba67898bd2d15c04689b041b280e6d78..6912032f628e82a313ec91ef8ae2273ae68a02c2 100755 (executable)
 use strict;
 use lib ".";
 
-require "globals.pl";
-
 use Bugzilla;
+use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::User;
 use Bugzilla::Bug;
 use Bugzilla::Flag;
-use Bugzilla::Config;
-use Bugzilla::Constants;
-use Bugzilla::Util;
 use Bugzilla::Field;
 use Bugzilla::Group;
 
index 2da48eed23278dee6492e3e74891b61fdbbfc52f..68cd6917a2a2a828400b4b434942af86f8628caa 100755 (executable)
 use strict;
 use lib ".";
 
-require "globals.pl";
 use Bugzilla;
 use Bugzilla::Util;
 use Bugzilla::Error;
 use Bugzilla::Constants;
-use Bugzilla::Config qw(:DEFAULT :admin :locations);
+use Bugzilla::Config qw(:DEFAULT :admin);
 
 # List of different tables that contain the changeable field values
 # (the old "enums.") Keep them in alphabetical order by their 
index dec675b5b403758c06a675b790cee81a5f5770d2..e8f7f4c358029f76df988b8f6559414441f2a309 100755 (executable)
@@ -21,7 +21,7 @@
 # Contributor(s): Holger Schurig <holgerschurig@nikocity.de>
 #                 Terry Weissman <terry@mozilla.org>
 #                 Gavin Shelley <bugzilla@chimpychompy.org>
-#                 Frédéric Buclin <LpSolit@gmail.com>
+#                 Frédéric Buclin <LpSolit@gmail.com>
 #
 #
 # Direct any questions on this source code to
 use strict;
 use lib ".";
 
-require "globals.pl";
-
 use Bugzilla;
 use Bugzilla::Constants;
-use Bugzilla::Config qw(:DEFAULT $datadir);
+use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Product;
 use Bugzilla::Version;
 
index 0db643552258d430871c56878f7fe86bd3c9e131..c4a1cae518c0496d5391f6403675a019326e4d67 100755 (executable)
 use strict;
 
 use lib ".";
-require "globals.pl";
 
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::User;
 use Bugzilla::Group;
+
 # require the user to have logged in
 my $user = Bugzilla->login(LOGIN_REQUIRED);
 
index 54b3f818b24878bb8d86664417f6aa1e7dd5b66b..43b413431d4f4ed97886b149d1e629ed9d88b639 100755 (executable)
@@ -39,6 +39,9 @@ use lib qw(.);
 
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Bug;
 use Bugzilla::User;
 use Bugzilla::Hook;
@@ -47,7 +50,6 @@ use Bugzilla::Classification;
 use Bugzilla::Keyword;
 use Bugzilla::Token;
 use Bugzilla::Field;
-require "globals.pl";
 
 my $user = Bugzilla->login(LOGIN_REQUIRED);
 
diff --git a/globals.pl b/globals.pl
deleted file mode 100644 (file)
index 146b515..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# -*- Mode: perl; indent-tabs-mode: nil -*-
-#
-# The contents of this file are subject to the Mozilla Public
-# License Version 1.1 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-#
-# The Original Code is the Bugzilla Bug Tracking System.
-#
-# The Initial Developer of the Original Code is Netscape Communications
-# Corporation. Portions created by Netscape are
-# Copyright (C) 1998 Netscape Communications Corporation. All
-# Rights Reserved.
-#
-# Contributor(s): Terry Weissman <terry@mozilla.org>
-#                 Dan Mosedale <dmose@mozilla.org>
-#                 Jacob Steenhagen <jake@bugzilla.org>
-#                 Bradley Baetz <bbaetz@student.usyd.edu.au>
-#                 Christopher Aillon <christopher@aillon.com>
-#                 Joel Peshkin <bugreport@peshkin.net>
-#                 Dave Lawrence <dkl@redhat.com>
-#                 Max Kanat-Alexander <mkanat@bugzilla.org>
-#                 Lance Larsh <lance.larsh@oracle.com>
-
-# Contains some global variables and routines used throughout bugzilla.
-
-use strict;
-
-use Bugzilla::Constants;
-use Bugzilla::Util;
-# Bring ChmodDataFile in until this is all moved to the module
-use Bugzilla::Config qw(:DEFAULT ChmodDataFile $localconfig $datadir);
-use Bugzilla::User;
-use Bugzilla::Error;
-
-# XXX - Move this to Bugzilla::Config once code which uses these has moved out
-# of globals.pl
-do $localconfig;
-
-1;
index 6faa172e3e07d18a423aa3f20132073723c4ef06..995238be1486f87bee9eed8818dac426fb9a8c90 100755 (executable)
@@ -79,7 +79,7 @@ use Bugzilla::Version;
 use Bugzilla::Component;
 use Bugzilla::Milestone;
 use Bugzilla::FlagType;
-use Bugzilla::Config qw(:DEFAULT $datadir);
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::BugMail;
 use Bugzilla::Mailer;
 use Bugzilla::User;
@@ -95,8 +95,6 @@ use Getopt::Long;
 use Pod::Usage;
 use XML::Twig;
 
-require "globals.pl";
-
 # We want to capture errors and handle them here rather than have the Template
 # code barf all over the place.
 Bugzilla->batch(1);
index a409fe95197f6c90b6026f4db7c7fc44b5641b55..42dfb8dde9be6d8e5735fb0a8ef35282a4da3b50 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -30,10 +30,11 @@ use strict;
 
 # Include the Bugzilla CGI and general utility library.
 use lib ".";
-require "globals.pl";
 
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Error;
 use Bugzilla::Update;
 
 # Check whether or not the user is logged in
index b160cf021bec2768d24b9c465037641a6828b7c9..43a826590d474e1a5737b69417f38218a042f67a 100755 (executable)
--- a/page.cgi
+++ b/page.cgi
@@ -33,8 +33,7 @@ use strict;
 use lib ".";
 
 use Bugzilla;
-
-require "globals.pl";
+use Bugzilla::Error;
 
 Bugzilla->login();
 
index 4cc00ce6b12808b822054105ec848d40fe16ee55..92c17b0589635a929640329575514b6ea454663b 100755 (executable)
 use strict;
 use lib qw(.);
 
-require "globals.pl";
 use Bugzilla;
 use Bugzilla::Attachment;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Bug;
 use Bugzilla::User;
 use Bugzilla::Field;
index 88377c78e52af70fac5617622783ee087f01b3b6..ee263bfbf910ffb12b7c5139000fac5352640460 100755 (executable)
@@ -48,13 +48,14 @@ my $lastbugid = 0;
 
 use lib qw(.);
 
-require "globals.pl";
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::Bug;
 use Bugzilla::Mailer;
 use Bugzilla::User;
 use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Field;
 use Bugzilla::Product;
 use Bugzilla::Component;
index 67fc963624478e6d30ae4b01a6ed69e227e67e5f..f7964f3b5d3a0b35e39f3702ace35eb1e9726097 100755 (executable)
--- a/query.cgi
+++ b/query.cgi
 use strict;
 use lib ".";
 
-require "globals.pl";
-
 use Bugzilla;
 use Bugzilla::Bug;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::Search;
 use Bugzilla::User;
 use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Product;
 use Bugzilla::Keyword;
 use Bugzilla::Field;
index fa421c5343a61fe169f3c24870d2d43c37261cf6..b50a922e45a6b2e1bd45ef369afd6c8460911577 100755 (executable)
--- a/quips.cgi
+++ b/quips.cgi
@@ -27,10 +27,12 @@ use strict;
 
 use lib qw(.);
 
-require "globals.pl";
-
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
+use Bugzilla::Error;
+use Bugzilla::User;
 
 my $user = Bugzilla->login(LOGIN_REQUIRED);
 
index 418ed35558ee0e79eb73b7ec75e4c0ef5ae7ee34..566a1df37447ca14dfadf9e478c9fc0b905ed9fb 100755 (executable)
@@ -25,8 +25,6 @@
 use strict;
 use lib qw(.);
 
-require "globals.pl";
-
 use Bugzilla;
 use Bugzilla::Mailer;
 use Bugzilla::Constants;
index c46361f1d082c7d5e50c6e9cab9b9da77b99eb88..10c532163e94ef9423a075ba4c0acc30bb51508e 100755 (executable)
 use strict;
 use lib ".";
 
-require "globals.pl";
-
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Field;
 
 my $cgi = Bugzilla->cgi;
index 5b043c93469cf79464f51f18669dcbdca86e5ecf..09b8dc30e737e78f6dc08fe8ff7a4c11ef696bbe 100755 (executable)
@@ -37,20 +37,20 @@ use strict;
 
 use lib qw(.);
 
-use Bugzilla::Config qw(:DEFAULT $datadir);
-
-require "globals.pl";
+use Bugzilla;
+use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
+use Bugzilla::Error;
 
 eval "use GD";
 $@ && ThrowCodeError("gd_not_installed");
 eval "use Chart::Lines";
 $@ && ThrowCodeError("chart_lines_not_installed");
 
-my $dir = "$datadir/mining";
+my $dir = bz_locations()->{'datadir'} . "/mining";
 my $graph_dir = "graphs";
 
-use Bugzilla;
-
 # If we're using bug groups for products, we should apply those restrictions
 # to viewing reports, as well.  Time to check the login in that case.
 my $user = Bugzilla->login();
index 5f90b87cbe64e75814eb579e8253c2f4ecc2099b..c0fb950c944b0d7d95d642ecd882263d176b597e 100755 (executable)
 use strict;
 
 use lib qw(.);
-require "globals.pl";
+
 use Bugzilla;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Flag;
 use Bugzilla::FlagType;
 use Bugzilla::User;
index 7a74bfc070e21329aa649af63f3c36463a768d7c..500c6a86352e9bb3af49ef728694a93c7388ba84 100755 (executable)
@@ -27,11 +27,10 @@ use strict;
 
 use lib qw(.);
 
-require "globals.pl";
-
 use Bugzilla;
 use Bugzilla::Constants;
 use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::User;
 
 ###########################################################################
index e44bc705431e061730e74026df26f8408ea09c0b..1eff56f3f8763720b13a9739fc71bc4e6eddfa95 100755 (executable)
@@ -26,9 +26,8 @@ use strict;
 
 use lib qw(.);
 
-require "globals.pl";
-
 use Bugzilla;
+use Bugzilla::Error;
 use Bugzilla::Bug;
 
 my $cgi = Bugzilla->cgi;
index 0efdad09ec9439bef3a971c0f17d0597d8349b37..2787c52526f9fb88649ceaedb67f7e437ad913f3 100755 (executable)
@@ -26,11 +26,10 @@ use lib qw(.);
 
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Error;
 use Bugzilla::User;
 use Bugzilla::Keyword;
-
-require "globals.pl";
-
 use Bugzilla::Bug;
 
 my $cgi = Bugzilla->cgi;
index ed87b6d90dce6b7ddc610d5379db69996712759c..e11c73ba31550f10e4f48e2dfe3a82ac3176d81d 100755 (executable)
@@ -26,13 +26,14 @@ use strict;
 use lib qw(.);
 
 use File::Temp;
+
 use Bugzilla;
-use Bugzilla::Config qw(:DEFAULT $webdotdir);
+use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Bug;
 
-require "globals.pl";
-
 Bugzilla->login();
 
 my $cgi = Bugzilla->cgi;
@@ -100,6 +101,7 @@ sub AddLink {
 }
 
 my $rankdir = $cgi->param('rankdir') || "LR";
+my $webdotdir = bz_locations()->{'webdotdir'};
 
 if (!defined $cgi->param('id') && !defined $cgi->param('doall')) {
     ThrowCodeError("missing_bug_id");
index b2cf29a57b06dbc3fe09a755ed1d2d4a66464a47..220b24926005afc726a9fb6e5d93a1df45a05e5c 100755 (executable)
@@ -27,8 +27,9 @@
 use strict;
 
 use lib qw(.);
-require "globals.pl";
+
 use Bugzilla;
+use Bugzilla::Error;
 use Bugzilla::Bug;
 
 my $user = Bugzilla->login();
index 671e44c7d9726169396beb67e2699e8f01785608..5619d6b407508af5c7c16bc8754b31286ec9c7e3 100755 (executable)
@@ -18,9 +18,9 @@
 use strict;
 
 use lib ".";
-require "globals.pl";
 
 use Bugzilla;
+use Bugzilla::Error;
 
 Bugzilla->login();
 my $cgi = Bugzilla->cgi;
index 388c82dba75f925fabca5c4510c6ae5638ff98cc..d2b939c82310bbe0cd6d2210eeb46cebfba17234 100755 (executable)
@@ -24,11 +24,12 @@ use Date::Parse;         # strptime
 use Date::Format;        # strftime
 
 use Bugzilla;
+use Bugzilla::Constants; # LOGIN_*
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::Bug;       # EmitDependList
 use Bugzilla::Util;      # trim
-use Bugzilla::Constants; # LOGIN_*
+use Bugzilla::Error;
 use Bugzilla::User;      # UserInGroup
-require "globals.pl";
 
 my $template = Bugzilla->template;
 my $vars = {};
@@ -360,7 +361,7 @@ sub get_inactive_bugs {
             WHERE  longdescs.bug_id IN ($buglist)
                    $date_bits } .
          $dbh->sql_group_by('longdescs.bug_id',
-                            'bugs.short_desc, bugs.bug_status,\r
+                            'bugs.short_desc, bugs.bug_status,
                              longdescs.bug_when') . qq{
             ORDER BY longdescs.bug_when};
     $sth = $dbh->prepare($q);
index 9cbfadf6e31215c5daa6ff8a45220a34e387d77b..034031c0b7f6c9709ebc8417f5fb1a0161dbbe6b 100644 (file)
@@ -86,7 +86,7 @@ foreach my $include_path (@include_paths) {
         INCLUDE_PATH => $include_path ,
         # Need to define filters used in the codebase, they don't
         # actually have to function in this test, just be defined.
-        # See globals.pl for the actual codebase definitions.
+        # See Template.pm for the actual codebase definitions.
 
         # Initialize templates (f.e. by loading plugins like Hook).
         PRE_PROCESS => "global/initialize.none.tmpl",
index 2211f8bfecba4dc3a95040eca95fd4de09094da8..766a2c41000647edb735034caab450d31eaa83f6 100755 (executable)
@@ -19,6 +19,7 @@
 # issues as possible.
 
 use strict;
+use lib ".";
 
 BEGIN {
     my $envpath = $ENV{'PATH'};
@@ -26,12 +27,13 @@ BEGIN {
     $ENV{'PATH'} = $envpath;
 }
 
-use lib ".";
+use Bugzilla::Constants;
+use Bugzilla::Config qw(:localconfig);
 
 use Socket;
-use Bugzilla::Config qw($datadir);
 
-require "globals.pl";
+my $datadir = bz_locations()->{'datadir'};
+
 eval "require LWP; require LWP::UserAgent;";
 my $lwp = $@ ? 0 : 1;
 
@@ -60,15 +62,15 @@ if ($^O !~ /MSWin32/i) {
 
 # Determine the numeric GID of $webservergroup
 my $webgroupnum = 0;
-if ($::webservergroup =~ /^(\d+)$/) {
+if ($webservergroup =~ /^(\d+)$/) {
     $webgroupnum = $1;
 } else {
-    eval { $webgroupnum = (getgrnam $::webservergroup) || 0; };
+    eval { $webgroupnum = (getgrnam $webservergroup) || 0; };
 }
 
 # Check $webservergroup against the server's GID
 if ($sgid > 0) {
-    if ($::webservergroup eq "") {
+    if ($webservergroup eq "") {
         print 
 "WARNING \$webservergroup is set to an empty string.
 That is a very insecure practice. Please refer to the
@@ -116,8 +118,9 @@ Check the AddHandler statement in your httpd.conf file.\n";
 }
 
 # Make sure that webserver is honoring .htaccess files
-$::localconfig =~ s~^\./~~;
-$url = $ARGV[0] . "/$::localconfig";
+my $localconfig = bz_locations()->{'localconfig'};
+$localconfig =~ s~^\./~~;
+$url = $ARGV[0] . "/$localconfig";
 $response = fetch($url);
 if ($response) {
     print 
index 061dc1e95713614ec34e46ba95cd57281ac2ad10..dcde8c108706dc62aa077a2ace8096749fee4412 100755 (executable)
--- a/token.cgi
+++ b/token.cgi
@@ -32,23 +32,17 @@ use lib qw(.);
 use Bugzilla;
 use Bugzilla::Constants;
 use Bugzilla::Util;
+use Bugzilla::Error;
+use Bugzilla::Token;
+use Bugzilla::User;
 
 my $cgi = Bugzilla->cgi;
 my $dbh = Bugzilla->dbh;
 my $template = Bugzilla->template;
 my $vars = {};
 
-# Include the Bugzilla CGI and general utility library.
-require "globals.pl";
-
 Bugzilla->login(LOGIN_OPTIONAL);
 
-# Use the "Bugzilla::Token" module that contains functions for doing various
-# token-related tasks.
-use Bugzilla::Token;
-
-use Bugzilla::User;
-
 ################################################################################
 # Data Validation / Security Authorization
 ################################################################################
index 26c4d585fd7f175d09ba7970719905fcfe6bb1f3..3288efe6585b4857aba9934b3fbbb3e24cea9c47 100755 (executable)
@@ -28,12 +28,12 @@ use lib qw(.);
 
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::Search;
 use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::User;
 
-require "globals.pl";
-
 my $template = Bugzilla->template;
 my $vars = {};
 
index 78b00ec1a591f5947344758f08db600146a31f60..36661c278a742324688aa823e0483e1f325558a8 100755 (executable)
--- a/votes.cgi
+++ b/votes.cgi
@@ -29,12 +29,13 @@ use lib ".";
 
 use Bugzilla;
 use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
+use Bugzilla::Error;
 use Bugzilla::Bug;
 use Bugzilla::User;
 use Bugzilla::Product;
 
-require "globals.pl";
-
 my $cgi = Bugzilla->cgi;
 my $template = Bugzilla->template;
 my $vars = {};
index 551defe49034eda8175dbf6d9039c36945c207d0..727e66af42055a6194cfc991d7449182651de46a 100755 (executable)
--- a/whine.pl
+++ b/whine.pl
 use strict;
 
 use lib ".";
-require "globals.pl";
 
 use Bugzilla;
-use Bugzilla::Config qw(:DEFAULT $datadir);
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::Constants;
 use Bugzilla::Search;
 use Bugzilla::User;
@@ -106,7 +105,7 @@ if ($fromaddress !~ Param('emailregexp')) {
 
 # Check the nomail file for users who should not receive mail
 my %nomail;
-if (open(NOMAIL, '<', "$datadir/nomail")) {
+if (open(NOMAIL, '<', bz_locations()->{'datadir'} . "/nomail")) {
     while (<NOMAIL>) {
         $nomail{trim($_)} = 1;
     }
index b05c19da07e14029443ee4e5fd8482939b280c06..1fcd6791133fbeff8d5e22712bb2e91926dc811e 100755 (executable)
@@ -30,9 +30,8 @@
 use strict;
 use lib '.';
 
-require "globals.pl";
-
 use Bugzilla;
+use Bugzilla::Config qw(:DEFAULT);
 use Bugzilla::Mailer;
 use Bugzilla::Util;