Commit c4111734 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 282121: Remove globals.pl from scripts that no longer use it - Patch by…

Bug 282121: Remove globals.pl from scripts that no longer use it - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
parent e6f88531
...@@ -47,9 +47,6 @@ that users upload to the Bugzilla server. ...@@ -47,9 +47,6 @@ that users upload to the Bugzilla server.
=cut =cut
# This module requires that its caller have said "require globals.pl"
# to import relevant functions from that script.
use Bugzilla::Error; use Bugzilla::Error;
use Bugzilla::Flag; use Bugzilla::Flag;
use Bugzilla::Config qw(:locations Param); use Bugzilla::Config qw(:locations Param);
......
...@@ -79,19 +79,16 @@ our @parampanels = (); ...@@ -79,19 +79,16 @@ our @parampanels = ();
# Don't export localvars by default - people should have to explicitly # Don't export localvars by default - people should have to explicitly
# ask for it, as a (probably futile) attempt to stop code using it # ask for it, as a (probably futile) attempt to stop code using it
# when it shouldn't # 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 = %Bugzilla::Config::EXPORT_TAGS =
( (
admin => [qw(UpdateParams SetParam WriteParams)], admin => [qw(UpdateParams SetParam WriteParams)],
db => [qw($db_driver $db_host $db_port $db_name $db_user $db_pass $db_sock)], 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 locations => [qw($libpath $localconfig $attachdir $datadir $templatedir
$webdotdir $project $extensionsdir)], $webdotdir $project $extensionsdir)],
params => [qw(@parampanels)], params => [qw(@parampanels)],
); );
Exporter::export_ok_tags('admin', 'db', 'locations', 'params'); Exporter::export_ok_tags('admin', 'db', 'localconfig', 'locations', 'params');
# Bugzilla version # Bugzilla version
$Bugzilla::Config::VERSION = "2.23.1+"; $Bugzilla::Config::VERSION = "2.23.1+";
......
...@@ -37,9 +37,6 @@ use Bugzilla::Util; ...@@ -37,9 +37,6 @@ use Bugzilla::Util;
use Date::Format; use Date::Format;
use Date::Parse; use Date::Parse;
# This module requires that its caller have said "require globals.pl" to import
# relevant functions from that script.
################################################################################ ################################################################################
# Constants # Constants
################################################################################ ################################################################################
......
...@@ -37,12 +37,10 @@ use strict; ...@@ -37,12 +37,10 @@ use strict;
use lib qw(.); use lib qw(.);
# Include the Bugzilla CGI and general utility library.
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Config qw(:locations); use Bugzilla::Config qw(:DEFAULT :localconfig);
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Flag; use Bugzilla::Flag;
use Bugzilla::FlagType; use Bugzilla::FlagType;
use Bugzilla::User; use Bugzilla::User;
...@@ -371,7 +369,7 @@ sub view ...@@ -371,7 +369,7 @@ sub view
{ {
my $hash = ($attach_id % 100) + 100; my $hash = ($attach_id % 100) + 100;
$hash =~ s/.*(\d\d)$/group.$1/; $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; binmode AH;
$filesize = (stat(AH))[7]; $filesize = (stat(AH))[7];
} }
...@@ -424,8 +422,8 @@ sub interdiff ...@@ -424,8 +422,8 @@ sub interdiff
# #
# Must hack path so that interdiff will work. # Must hack path so that interdiff will work.
# #
$ENV{'PATH'} = $::diffpath; $ENV{'PATH'} = $diffpath;
open my $interdiff_fh, "$::interdiffbin $old_filename $new_filename|"; open my $interdiff_fh, "$interdiffbin $old_filename $new_filename|";
binmode $interdiff_fh; binmode $interdiff_fh;
my ($reader, $last_reader) = setup_patch_readers("", $context); my ($reader, $last_reader) = setup_patch_readers("", $context);
if ($format eq 'raw') if ($format eq 'raw')
...@@ -558,7 +556,7 @@ sub setup_patch_readers { ...@@ -558,7 +556,7 @@ sub setup_patch_readers {
$last_reader = $last_reader->sends_data_to; $last_reader = $last_reader->sends_data_to;
} }
# Add in cvs context if we have the necessary info to do it # Add in cvs context if we have the necessary info to do it
if ($context ne "patch" && $::cvsbin && Param('cvsroot_get')) if ($context ne "patch" && $cvsbin && Param('cvsroot_get'))
{ {
require PatchReader::AddCVSContext; require PatchReader::AddCVSContext;
$last_reader->sends_data_to( $last_reader->sends_data_to(
...@@ -583,7 +581,7 @@ sub setup_template_patch_reader ...@@ -583,7 +581,7 @@ sub setup_template_patch_reader
} }
$vars->{collapsed} = $cgi->param('collapsed'); $vars->{collapsed} = $cgi->param('collapsed');
$vars->{context} = $context; $vars->{context} = $context;
$vars->{do_context} = $::cvsbin && Param('cvsroot_get') && !$vars->{'newid'}; $vars->{do_context} = $cvsbin && Param('cvsroot_get') && !$vars->{'newid'};
# Print everything out # Print everything out
print $cgi->header(-type => 'text/html', print $cgi->header(-type => 'text/html',
...@@ -634,7 +632,7 @@ sub diff ...@@ -634,7 +632,7 @@ sub diff
else else
{ {
$vars->{other_patches} = []; $vars->{other_patches} = [];
if ($::interdiffbin && $::diffpath) { if ($interdiffbin && $diffpath) {
# Get list of attachments on this bug. # Get list of attachments on this bug.
# Ignore the current patch, but select the one right before it # Ignore the current patch, but select the one right before it
# chronologically. # chronologically.
......
...@@ -35,9 +35,12 @@ use strict; ...@@ -35,9 +35,12 @@ use strict;
use lib qw(.); use lib qw(.);
use Bugzilla; use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Util;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Search; use Bugzilla::Search;
use Bugzilla::Search::Quicksearch; use Bugzilla::Search::Quicksearch;
use Bugzilla::Constants;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Bug; use Bugzilla::Bug;
use Bugzilla::Product; use Bugzilla::Product;
...@@ -46,9 +49,6 @@ use Bugzilla::Field; ...@@ -46,9 +49,6 @@ use Bugzilla::Field;
use Date::Parse; use Date::Parse;
# Include the Bugzilla CGI and general utility library.
require "globals.pl";
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $template = Bugzilla->template; my $template = Bugzilla->template;
...@@ -894,7 +894,7 @@ if ($serverpush) { ...@@ -894,7 +894,7 @@ if ($serverpush) {
# query performance. # query performance.
$dbh = Bugzilla->switch_to_shadow_db(); $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 # respond to them here to prevent someone DOSing us by reloading a query
# a large number of times. # a large number of times.
$::SIG{TERM} = 'DEFAULT'; $::SIG{TERM} = 'DEFAULT';
......
...@@ -45,9 +45,11 @@ ...@@ -45,9 +45,11 @@
use strict; use strict;
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Error;
use Bugzilla::Util;
use Bugzilla::Chart; use Bugzilla::Chart;
use Bugzilla::Series; use Bugzilla::Series;
use Bugzilla::User; use Bugzilla::User;
......
...@@ -1048,11 +1048,6 @@ while (my ($table, $values) = each %$enum_values) { ...@@ -1048,11 +1048,6 @@ while (my ($table, $values) = each %$enum_values) {
# Create initial --DATA-- directory and make the initial empty files there: # 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") { unless (-d $datadir && -e "$datadir/nomail") {
print "Creating data directory ($datadir) ...\n"; print "Creating data directory ($datadir) ...\n";
# permissions for non-webservergroup are fixed later on # permissions for non-webservergroup are fixed later on
...@@ -1596,8 +1591,7 @@ if ($^O !~ /MSWin32/i) { ...@@ -1596,8 +1591,7 @@ if ($^O !~ /MSWin32/i) {
fixPerms('css', $<, $webservergid, 027, 1); fixPerms('css', $<, $webservergid, 027, 1);
fixPerms('skins', $<, $webservergid, 027, 1); fixPerms('skins', $<, $webservergid, 027, 1);
fixPerms('js', $<, $webservergid, 027, 1); fixPerms('js', $<, $webservergid, 027, 1);
chmod 0644, 'globals.pl';
# Don't use fixPerms here, because it won't change perms # Don't use fixPerms here, because it won't change perms
# on the directory unless it's using recursion # on the directory unless it's using recursion
chown $<, $webservergid, $datadir; chown $<, $webservergid, $datadir;
......
...@@ -27,9 +27,10 @@ use lib qw(.); ...@@ -27,9 +27,10 @@ use lib qw(.);
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Error;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Keyword; use Bugzilla::Keyword;
require "globals.pl";
Bugzilla->login(); Bugzilla->login();
......
...@@ -34,9 +34,11 @@ use strict; ...@@ -34,9 +34,11 @@ use strict;
use IO::Handle; use IO::Handle;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util;
use Bugzilla::Search; use Bugzilla::Search;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Product; use Bugzilla::Product;
...@@ -63,6 +65,8 @@ if ($#ARGV >= 0 && $ARGV[0] eq "--regenerate") { ...@@ -63,6 +65,8 @@ if ($#ARGV >= 0 && $ARGV[0] eq "--regenerate") {
$regenerate = 1; $regenerate = 1;
} }
my $datadir = bz_locations()->{'datadir'};
my @myproducts = map {$_->name} Bugzilla::Product::get_all_products(); my @myproducts = map {$_->name} Bugzilla::Product::get_all_products();
unshift(@myproducts, "-All-"); unshift(@myproducts, "-All-");
...@@ -71,7 +75,7 @@ foreach (@myproducts) { ...@@ -71,7 +75,7 @@ foreach (@myproducts) {
my $dir = "$datadir/mining"; my $dir = "$datadir/mining";
&check_data_dir ($dir); &check_data_dir ($dir);
if ($regenerate) { if ($regenerate) {
&regenerate_stats($dir, $_); &regenerate_stats($dir, $_);
} else { } else {
...@@ -206,6 +210,8 @@ sub calculate_dupes { ...@@ -206,6 +210,8 @@ sub calculate_dupes {
# Save % count here in a date-named file # Save % count here in a date-named file
# so we can read it back in to do changed counters # 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 # 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*>) { if (my @files = <$datadir/duplicates/dupes$today*>) {
map { trick_taint($_) } @files; map { trick_taint($_) } @files;
unlink @files; unlink @files;
......
...@@ -28,11 +28,12 @@ ...@@ -28,11 +28,12 @@
# Make it harder for us to do dangerous things in Perl. # Make it harder for us to do dangerous things in Perl.
use strict; use strict;
# Include the Bugzilla CGI and general utility library.
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Error;
use Bugzilla::Keyword; use Bugzilla::Keyword;
use Bugzilla::Bug; use Bugzilla::Bug;
use Bugzilla::Field; use Bugzilla::Field;
......
...@@ -28,10 +28,9 @@ ...@@ -28,10 +28,9 @@
push @INC, "../."; # this script now lives in contrib push @INC, "../."; # this script now lives in contrib
require "globals.pl";
use strict; use strict;
use Bugzilla;
my $EMAIL_TRANSFORM_NONE = "email_transform_none"; my $EMAIL_TRANSFORM_NONE = "email_transform_none";
my $EMAIL_TRANSFORM_BASE_DOMAIN = "email_transform_base_domain"; my $EMAIL_TRANSFORM_BASE_DOMAIN = "email_transform_base_domain";
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
# #
# You need to work with bug_email.pl the MIME::Parser installed. # You need to work with bug_email.pl the MIME::Parser installed.
# #
# $Id: bug_email.pl,v 1.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) # 02/12/2000 (SML)
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
# - querying a bug over email # - querying a bug over email
# - appending a bug over email # - appending a bug over email
# - keywords 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 # - integrate some setup in the checksetup.pl script
# - gpg signatures for security # - gpg signatures for security
...@@ -86,14 +86,14 @@ BEGIN { ...@@ -86,14 +86,14 @@ BEGIN {
push @INC, "."; push @INC, ".";
} }
require "globals.pl";
use Bugzilla;
use BugzillaEmail;
use Bugzilla::Config qw(:DEFAULT $datadir);
use lib "."; use lib ".";
use lib "../"; use lib "../";
use Bugzilla;
use BugzillaEmail;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Util;
use Bugzilla::BugMail; use Bugzilla::BugMail;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Product; use Bugzilla::Product;
...@@ -228,7 +228,7 @@ sub Reply( $$$$ ) { ...@@ -228,7 +228,7 @@ sub Reply( $$$$ ) {
die "Cannot find sender-email-address" unless defined( $Sender ); die "Cannot find sender-email-address" unless defined( $Sender );
if( $test ) { if( $test ) {
open( MAIL, '>>', "$datadir/bug_email_test.log" ); open( MAIL, '>>', bz_locations()->{'datadir'} . "/bug_email_test.log" );
} }
else { else {
open( MAIL, "| /usr/sbin/sendmail -t" ); open( MAIL, "| /usr/sbin/sendmail -t" );
...@@ -669,6 +669,7 @@ my $parser = new MIME::Parser; ...@@ -669,6 +669,7 @@ my $parser = new MIME::Parser;
# Create and set the output directory: # Create and set the output directory:
# FIXME: There should be a $BUGZILLA_HOME variable (SML) # 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: $!"; (-d "$datadir/mimedump-tmp") or mkdir "$datadir/mimedump-tmp",0755 or die "mkdir: $!";
(-w "$datadir/mimedump-tmp") or die "can't write to directory"; (-w "$datadir/mimedump-tmp") or die "can't write to directory";
......
...@@ -37,10 +37,10 @@ BEGIN { ...@@ -37,10 +37,10 @@ BEGIN {
push @INC, "."; # this script lives in contrib push @INC, "."; # this script lives in contrib
} }
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants;
use BugzillaEmail; use BugzillaEmail;
use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::BugMail; use Bugzilla::BugMail;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
...@@ -52,6 +52,7 @@ my $Comment = ""; ...@@ -52,6 +52,7 @@ my $Comment = "";
# Create and set the output directory: # Create and set the output directory:
# FIXME: There should be a $BUGZILLA_HOME variable (SML) # 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: $!"; (-d "$datadir/mimedump-tmp") or mkdir "$datadir/mimedump-tmp",0755 or die "mkdir: $!";
(-w "$datadir/mimedump-tmp") or die "can't write to directory"; (-w "$datadir/mimedump-tmp") or die "can't write to directory";
...@@ -153,45 +154,45 @@ sub dump_entity { ...@@ -153,45 +154,45 @@ sub dump_entity {
# Output the body: # Output the body:
my @parts = $entity->parts; my @parts = $entity->parts;
if (@parts) { # multipart... if (@parts) { # multipart...
my $i; my $i;
foreach $i (0 .. $#parts) { # dump each part... foreach $i (0 .. $#parts) { # dump each part...
dump_entity($parts[$i], ("$name, part ".(1+$i))); dump_entity($parts[$i], ("$name, part ".(1+$i)));
} }
} else { # single part... } else { # single part...
# Get MIME type, and display accordingly... # Get MIME type, and display accordingly...
my $msg_part = $entity->head->get( 'Content-Disposition' ); my $msg_part = $entity->head->get( 'Content-Disposition' );
$msg_part ||= ""; $msg_part ||= "";
my ($type, $subtype) = split('/', $entity->head->mime_type); my ($type, $subtype) = split('/', $entity->head->mime_type);
my $body = $entity->bodyhandle; my $body = $entity->bodyhandle;
my ($data, $on_disk ); my ($data, $on_disk );
if( $msg_part =~ /^attachment/ ) { if( $msg_part =~ /^attachment/ ) {
# Attached File # Attached File
my $des = $entity->head->get('Content-Description'); my $des = $entity->head->get('Content-Description');
$des ||= ""; $des ||= "";
if( defined( $body->path )) { # Data is on disk if( defined( $body->path )) { # Data is on disk
$on_disk = 1; $on_disk = 1;
$data = $body->path; $data = $body->path;
} else { # Data is in core } else { # Data is in core
$on_disk = 0; $on_disk = 0;
$data = $body->as_string; $data = $body->as_string;
} }
# push ( @attachments, [ $data, $entity->head->mime_type, $on_disk, $des ] ); # push ( @attachments, [ $data, $entity->head->mime_type, $on_disk, $des ] );
} else { } else {
# Real Message # Real Message
if ($type =~ /^(text|message)$/) { # text: display it... if ($type =~ /^(text|message)$/) { # text: display it...
if ($IO = $body->open("r")) { if ($IO = $body->open("r")) {
$Comment .= $_ while (defined($_ = $IO->getline)); $Comment .= $_ while (defined($_ = $IO->getline));
$IO->close; $IO->close;
} else { # d'oh! } else { # d'oh!
print "$0: couldn't find/open '$name': $!"; print "$0: couldn't find/open '$name': $!";
} }
} else { print "Oooops - no Body !\n"; } } else { print "Oooops - no Body !\n"; }
} }
} }
} }
...@@ -861,8 +861,6 @@ sub map_username_to_realname() { ...@@ -861,8 +861,6 @@ sub map_username_to_realname() {
return(""); return("");
} }
# This routine was copied from globals.pl which was largely copied
# from Mysql.pm.
sub detaint_string { sub detaint_string {
my ($str) = @_; my ($str) = @_;
$str =~ m/^(.*)$/s; $str =~ m/^(.*)$/s;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Nick Barnes, Ravenbrook Limited, 2004-04-01. # Nick Barnes, Ravenbrook Limited, 2004-04-01.
# #
# $Id: sendbugmail.pl,v 1.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 # Bugzilla email script for Bugzilla 2.17.4 and later. Invoke this to send
# bugmail for a bug which has been changed directly in the database. # bugmail for a bug which has been changed directly in the database.
...@@ -16,8 +16,9 @@ ...@@ -16,8 +16,9 @@
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util;
use Bugzilla::BugMail; use Bugzilla::BugMail;
use Bugzilla::User; use Bugzilla::User;
......
...@@ -25,7 +25,6 @@ use strict; ...@@ -25,7 +25,6 @@ use strict;
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::BugMail; use Bugzilla::BugMail;
......
...@@ -13,22 +13,20 @@ ...@@ -13,22 +13,20 @@
# #
# The Original Code is the LDAP to Bugzilla User Sync Tool. # The Original Code is the LDAP to Bugzilla User Sync Tool.
# #
# The Initial Developer of the Original Code is Andreas Hfler. # The Initial Developer of the Original Code is Andreas Höfler.
# Portions created by Andreas Hfler are Copyright (C) 2003 # Portions created by Andreas Höfler are Copyright (C) 2003
# Andreas Hfler. All # Andreas Höfler. All Rights Reserved.
# Rights Reserved.
# #
# Contributor(s): Andreas Hfler <andreas.hoefler@bearingpoint.com> # Contributor(s): Andreas Höfler <andreas.hoefler@bearingpoint.com>
# #
use strict; use strict;
require "globals.pl";
use lib qw(.); use lib qw(.);
use Net::LDAP; use Net::LDAP;
use Bugzilla; use Bugzilla;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::User; use Bugzilla::User;
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
......
...@@ -28,10 +28,10 @@ use strict; ...@@ -28,10 +28,10 @@ use strict;
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Error;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::BugMail; use Bugzilla::BugMail;
use Bugzilla::Util; use Bugzilla::Util;
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
use strict; use strict;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Field; use Bugzilla::Field;
......
...@@ -27,7 +27,8 @@ use lib qw(.); ...@@ -27,7 +27,8 @@ use lib qw(.);
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
require "globals.pl"; use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Product; use Bugzilla::Product;
my $user = Bugzilla->login(); my $user = Bugzilla->login();
......
...@@ -25,10 +25,9 @@ use strict; ...@@ -25,10 +25,9 @@ use strict;
use lib "."; use lib ".";
use Bugzilla; use Bugzilla;
use Bugzilla::Error;
use Bugzilla::User; use Bugzilla::User;
require "globals.pl";
Bugzilla->login(); Bugzilla->login();
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
......
...@@ -29,12 +29,12 @@ use AnyDBM_File; ...@@ -29,12 +29,12 @@ use AnyDBM_File;
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Search;
use Bugzilla::Config qw(:DEFAULT $datadir);
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Search;
use Bugzilla::Product; use Bugzilla::Product;
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
...@@ -106,6 +106,8 @@ my $yesterday = days_ago(1); ...@@ -106,6 +106,8 @@ my $yesterday = days_ago(1);
use Errno; use Errno;
use Fcntl; use Fcntl;
my $datadir = bz_locations()->{'datadir'};
if (!tie(%dbmcount, 'AnyDBM_File', "$datadir/duplicates/dupes$today", if (!tie(%dbmcount, 'AnyDBM_File', "$datadir/duplicates/dupes$today",
O_RDONLY, 0644)) { O_RDONLY, 0644)) {
if ($!{ENOENT}) { if ($!{ENOENT}) {
......
...@@ -27,11 +27,9 @@ use Bugzilla; ...@@ -27,11 +27,9 @@ use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error; use Bugzilla::Error;
use Bugzilla::Config qw($datadir); use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Classification; use Bugzilla::Classification;
require "globals.pl";
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $template = Bugzilla->template; my $template = Bugzilla->template;
......
...@@ -29,13 +29,12 @@ ...@@ -29,13 +29,12 @@
use strict; use strict;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Series; use Bugzilla::Series;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Product; use Bugzilla::Product;
use Bugzilla::Component; use Bugzilla::Component;
......
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
use strict; use strict;
use lib "."; use lib ".";
# Include the Bugzilla CGI and general utility library.
require "globals.pl";
# Use Bugzilla's flag modules for handling flag types. # Use Bugzilla's flag modules for handling flag types.
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
...@@ -39,6 +36,7 @@ use Bugzilla::Flag; ...@@ -39,6 +36,7 @@ use Bugzilla::Flag;
use Bugzilla::FlagType; use Bugzilla::FlagType;
use Bugzilla::Group; use Bugzilla::Group;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Product; use Bugzilla::Product;
use Bugzilla::Component; use Bugzilla::Component;
use Bugzilla::Bug; use Bugzilla::Bug;
......
...@@ -24,18 +24,17 @@ ...@@ -24,18 +24,17 @@
# Vlad Dascalu <jocuri@softhome.net> # Vlad Dascalu <jocuri@softhome.net>
# Frédéric Buclin <LpSolit@gmail.com> # Frédéric Buclin <LpSolit@gmail.com>
# Code derived from editowners.cgi and editusers.cgi
use strict; use strict;
use lib "."; use lib ".";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT :admin); use Bugzilla::Config qw(:DEFAULT :admin);
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Group; use Bugzilla::Group;
use Bugzilla::Product; use Bugzilla::Product;
use Bugzilla::User; use Bugzilla::User;
require "globals.pl";
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
......
...@@ -23,11 +23,10 @@ ...@@ -23,11 +23,10 @@
use strict; use strict;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::Util;
use Bugzilla::Error;
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
......
...@@ -12,18 +12,17 @@ ...@@ -12,18 +12,17 @@
# Matt Masson <matthew@zeroknowledge.com> # Matt Masson <matthew@zeroknowledge.com>
# #
# Contributors : Gavin Shelley <bugzilla@chimpychompy.org> # Contributors : Gavin Shelley <bugzilla@chimpychompy.org>
# Frdric Buclin <LpSolit@gmail.com> # Frédéric Buclin <LpSolit@gmail.com>
# #
use strict; use strict;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Product; use Bugzilla::Product;
use Bugzilla::Milestone; use Bugzilla::Milestone;
use Bugzilla::Bug; use Bugzilla::Bug;
......
...@@ -27,10 +27,11 @@ use lib "."; ...@@ -27,10 +27,11 @@ use lib ".";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT :admin :params $datadir); use Bugzilla::Config qw(:DEFAULT :admin :params);
use Bugzilla::Config::Common; use Bugzilla::Config::Common;
use Bugzilla::Util;
use Bugzilla::Error;
require "globals.pl";
use vars qw(@parampanels); use vars qw(@parampanels);
my $user = Bugzilla->login(LOGIN_REQUIRED); my $user = Bugzilla->login(LOGIN_REQUIRED);
......
...@@ -33,12 +33,14 @@ ...@@ -33,12 +33,14 @@
use strict; use strict;
use lib "."; use lib ".";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
require "globals.pl"; use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Bug; use Bugzilla::Bug;
use Bugzilla::Series; use Bugzilla::Series;
use Bugzilla::Config qw(:DEFAULT $datadir);
use Bugzilla::Mailer; use Bugzilla::Mailer;
use Bugzilla::Product; use Bugzilla::Product;
use Bugzilla::Classification; use Bugzilla::Classification;
......
...@@ -21,10 +21,10 @@ use lib qw(.); ...@@ -21,10 +21,10 @@ use lib qw(.);
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::User::Setting; use Bugzilla::User::Setting;
require "globals.pl";
my $template = Bugzilla->template; my $template = Bugzilla->template;
my $vars = {}; my $vars = {};
......
...@@ -23,15 +23,14 @@ ...@@ -23,15 +23,14 @@
use strict; use strict;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Bug; use Bugzilla::Bug;
use Bugzilla::Flag; use Bugzilla::Flag;
use Bugzilla::Config;
use Bugzilla::Constants;
use Bugzilla::Util;
use Bugzilla::Field; use Bugzilla::Field;
use Bugzilla::Group; use Bugzilla::Group;
......
...@@ -21,12 +21,11 @@ ...@@ -21,12 +21,11 @@
use strict; use strict;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error; use Bugzilla::Error;
use Bugzilla::Constants; 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 # List of different tables that contain the changeable field values
# (the old "enums.") Keep them in alphabetical order by their # (the old "enums.") Keep them in alphabetical order by their
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
# Contributor(s): Holger Schurig <holgerschurig@nikocity.de> # Contributor(s): Holger Schurig <holgerschurig@nikocity.de>
# Terry Weissman <terry@mozilla.org> # Terry Weissman <terry@mozilla.org>
# Gavin Shelley <bugzilla@chimpychompy.org> # Gavin Shelley <bugzilla@chimpychompy.org>
# Frdric Buclin <LpSolit@gmail.com> # Frédéric Buclin <LpSolit@gmail.com>
# #
# #
# Direct any questions on this source code to # Direct any questions on this source code to
...@@ -31,11 +31,10 @@ ...@@ -31,11 +31,10 @@
use strict; use strict;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Product; use Bugzilla::Product;
use Bugzilla::Version; use Bugzilla::Version;
......
...@@ -28,12 +28,15 @@ ...@@ -28,12 +28,15 @@
use strict; use strict;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Group; use Bugzilla::Group;
# require the user to have logged in # require the user to have logged in
my $user = Bugzilla->login(LOGIN_REQUIRED); my $user = Bugzilla->login(LOGIN_REQUIRED);
......
...@@ -39,6 +39,9 @@ use lib qw(.); ...@@ -39,6 +39,9 @@ use lib qw(.);
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Bug; use Bugzilla::Bug;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Hook; use Bugzilla::Hook;
...@@ -47,7 +50,6 @@ use Bugzilla::Classification; ...@@ -47,7 +50,6 @@ use Bugzilla::Classification;
use Bugzilla::Keyword; use Bugzilla::Keyword;
use Bugzilla::Token; use Bugzilla::Token;
use Bugzilla::Field; use Bugzilla::Field;
require "globals.pl";
my $user = Bugzilla->login(LOGIN_REQUIRED); my $user = Bugzilla->login(LOGIN_REQUIRED);
......
# -*- 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;
...@@ -79,7 +79,7 @@ use Bugzilla::Version; ...@@ -79,7 +79,7 @@ use Bugzilla::Version;
use Bugzilla::Component; use Bugzilla::Component;
use Bugzilla::Milestone; use Bugzilla::Milestone;
use Bugzilla::FlagType; use Bugzilla::FlagType;
use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::BugMail; use Bugzilla::BugMail;
use Bugzilla::Mailer; use Bugzilla::Mailer;
use Bugzilla::User; use Bugzilla::User;
...@@ -95,8 +95,6 @@ use Getopt::Long; ...@@ -95,8 +95,6 @@ use Getopt::Long;
use Pod::Usage; use Pod::Usage;
use XML::Twig; use XML::Twig;
require "globals.pl";
# We want to capture errors and handle them here rather than have the Template # We want to capture errors and handle them here rather than have the Template
# code barf all over the place. # code barf all over the place.
Bugzilla->batch(1); Bugzilla->batch(1);
......
...@@ -30,10 +30,11 @@ use strict; ...@@ -30,10 +30,11 @@ use strict;
# Include the Bugzilla CGI and general utility library. # Include the Bugzilla CGI and general utility library.
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Error;
use Bugzilla::Update; use Bugzilla::Update;
# Check whether or not the user is logged in # Check whether or not the user is logged in
......
...@@ -33,8 +33,7 @@ use strict; ...@@ -33,8 +33,7 @@ use strict;
use lib "."; use lib ".";
use Bugzilla; use Bugzilla;
use Bugzilla::Error;
require "globals.pl";
Bugzilla->login(); Bugzilla->login();
......
...@@ -27,11 +27,12 @@ ...@@ -27,11 +27,12 @@
use strict; use strict;
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Attachment; use Bugzilla::Attachment;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Bug; use Bugzilla::Bug;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Field; use Bugzilla::Field;
......
...@@ -48,13 +48,14 @@ my $lastbugid = 0; ...@@ -48,13 +48,14 @@ my $lastbugid = 0;
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Bug; use Bugzilla::Bug;
use Bugzilla::Mailer; use Bugzilla::Mailer;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Field; use Bugzilla::Field;
use Bugzilla::Product; use Bugzilla::Product;
use Bugzilla::Component; use Bugzilla::Component;
......
...@@ -28,14 +28,14 @@ ...@@ -28,14 +28,14 @@
use strict; use strict;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Bug; use Bugzilla::Bug;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Search; use Bugzilla::Search;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Product; use Bugzilla::Product;
use Bugzilla::Keyword; use Bugzilla::Keyword;
use Bugzilla::Field; use Bugzilla::Field;
......
...@@ -27,10 +27,12 @@ use strict; ...@@ -27,10 +27,12 @@ use strict;
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::User;
my $user = Bugzilla->login(LOGIN_REQUIRED); my $user = Bugzilla->login(LOGIN_REQUIRED);
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
use strict; use strict;
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Mailer; use Bugzilla::Mailer;
use Bugzilla::Constants; use Bugzilla::Constants;
......
...@@ -24,10 +24,10 @@ ...@@ -24,10 +24,10 @@
use strict; use strict;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Field; use Bugzilla::Field;
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
......
...@@ -37,20 +37,20 @@ use strict; ...@@ -37,20 +37,20 @@ use strict;
use lib qw(.); use lib qw(.);
use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla;
use Bugzilla::Constants;
require "globals.pl"; use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util;
use Bugzilla::Error;
eval "use GD"; eval "use GD";
$@ && ThrowCodeError("gd_not_installed"); $@ && ThrowCodeError("gd_not_installed");
eval "use Chart::Lines"; eval "use Chart::Lines";
$@ && ThrowCodeError("chart_lines_not_installed"); $@ && ThrowCodeError("chart_lines_not_installed");
my $dir = "$datadir/mining"; my $dir = bz_locations()->{'datadir'} . "/mining";
my $graph_dir = "graphs"; my $graph_dir = "graphs";
use Bugzilla;
# If we're using bug groups for products, we should apply those restrictions # 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. # to viewing reports, as well. Time to check the login in that case.
my $user = Bugzilla->login(); my $user = Bugzilla->login();
......
...@@ -29,8 +29,11 @@ ...@@ -29,8 +29,11 @@
use strict; use strict;
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Flag; use Bugzilla::Flag;
use Bugzilla::FlagType; use Bugzilla::FlagType;
use Bugzilla::User; use Bugzilla::User;
......
...@@ -27,11 +27,10 @@ use strict; ...@@ -27,11 +27,10 @@ use strict;
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::User; use Bugzilla::User;
########################################################################### ###########################################################################
......
...@@ -26,9 +26,8 @@ use strict; ...@@ -26,9 +26,8 @@ use strict;
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Error;
use Bugzilla::Bug; use Bugzilla::Bug;
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
......
...@@ -26,11 +26,10 @@ use lib qw(.); ...@@ -26,11 +26,10 @@ use lib qw(.);
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Error;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Keyword; use Bugzilla::Keyword;
require "globals.pl";
use Bugzilla::Bug; use Bugzilla::Bug;
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
......
...@@ -26,13 +26,14 @@ use strict; ...@@ -26,13 +26,14 @@ use strict;
use lib qw(.); use lib qw(.);
use File::Temp; use File::Temp;
use Bugzilla; use Bugzilla;
use Bugzilla::Config qw(:DEFAULT $webdotdir); use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Bug; use Bugzilla::Bug;
require "globals.pl";
Bugzilla->login(); Bugzilla->login();
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
...@@ -100,6 +101,7 @@ sub AddLink { ...@@ -100,6 +101,7 @@ sub AddLink {
} }
my $rankdir = $cgi->param('rankdir') || "LR"; my $rankdir = $cgi->param('rankdir') || "LR";
my $webdotdir = bz_locations()->{'webdotdir'};
if (!defined $cgi->param('id') && !defined $cgi->param('doall')) { if (!defined $cgi->param('id') && !defined $cgi->param('doall')) {
ThrowCodeError("missing_bug_id"); ThrowCodeError("missing_bug_id");
......
...@@ -27,8 +27,9 @@ ...@@ -27,8 +27,9 @@
use strict; use strict;
use lib qw(.); use lib qw(.);
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Error;
use Bugzilla::Bug; use Bugzilla::Bug;
my $user = Bugzilla->login(); my $user = Bugzilla->login();
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
use strict; use strict;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Error;
Bugzilla->login(); Bugzilla->login();
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
......
...@@ -24,11 +24,12 @@ use Date::Parse; # strptime ...@@ -24,11 +24,12 @@ use Date::Parse; # strptime
use Date::Format; # strftime use Date::Format; # strftime
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; # LOGIN_*
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Bug; # EmitDependList use Bugzilla::Bug; # EmitDependList
use Bugzilla::Util; # trim use Bugzilla::Util; # trim
use Bugzilla::Constants; # LOGIN_* use Bugzilla::Error;
use Bugzilla::User; # UserInGroup use Bugzilla::User; # UserInGroup
require "globals.pl";
my $template = Bugzilla->template; my $template = Bugzilla->template;
my $vars = {}; my $vars = {};
...@@ -360,7 +361,7 @@ sub get_inactive_bugs { ...@@ -360,7 +361,7 @@ sub get_inactive_bugs {
WHERE longdescs.bug_id IN ($buglist) WHERE longdescs.bug_id IN ($buglist)
$date_bits } . $date_bits } .
$dbh->sql_group_by('longdescs.bug_id', $dbh->sql_group_by('longdescs.bug_id',
'bugs.short_desc, bugs.bug_status, 'bugs.short_desc, bugs.bug_status,
longdescs.bug_when') . qq{ longdescs.bug_when') . qq{
ORDER BY longdescs.bug_when}; ORDER BY longdescs.bug_when};
$sth = $dbh->prepare($q); $sth = $dbh->prepare($q);
......
...@@ -86,7 +86,7 @@ foreach my $include_path (@include_paths) { ...@@ -86,7 +86,7 @@ foreach my $include_path (@include_paths) {
INCLUDE_PATH => $include_path , INCLUDE_PATH => $include_path ,
# Need to define filters used in the codebase, they don't # Need to define filters used in the codebase, they don't
# actually have to function in this test, just be defined. # 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). # Initialize templates (f.e. by loading plugins like Hook).
PRE_PROCESS => "global/initialize.none.tmpl", PRE_PROCESS => "global/initialize.none.tmpl",
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
# issues as possible. # issues as possible.
use strict; use strict;
use lib ".";
BEGIN { BEGIN {
my $envpath = $ENV{'PATH'}; my $envpath = $ENV{'PATH'};
...@@ -26,12 +27,13 @@ BEGIN { ...@@ -26,12 +27,13 @@ BEGIN {
$ENV{'PATH'} = $envpath; $ENV{'PATH'} = $envpath;
} }
use lib "."; use Bugzilla::Constants;
use Bugzilla::Config qw(:localconfig);
use Socket; use Socket;
use Bugzilla::Config qw($datadir);
require "globals.pl"; my $datadir = bz_locations()->{'datadir'};
eval "require LWP; require LWP::UserAgent;"; eval "require LWP; require LWP::UserAgent;";
my $lwp = $@ ? 0 : 1; my $lwp = $@ ? 0 : 1;
...@@ -60,15 +62,15 @@ if ($^O !~ /MSWin32/i) { ...@@ -60,15 +62,15 @@ if ($^O !~ /MSWin32/i) {
# Determine the numeric GID of $webservergroup # Determine the numeric GID of $webservergroup
my $webgroupnum = 0; my $webgroupnum = 0;
if ($::webservergroup =~ /^(\d+)$/) { if ($webservergroup =~ /^(\d+)$/) {
$webgroupnum = $1; $webgroupnum = $1;
} else { } else {
eval { $webgroupnum = (getgrnam $::webservergroup) || 0; }; eval { $webgroupnum = (getgrnam $webservergroup) || 0; };
} }
# Check $webservergroup against the server's GID # Check $webservergroup against the server's GID
if ($sgid > 0) { if ($sgid > 0) {
if ($::webservergroup eq "") { if ($webservergroup eq "") {
print print
"WARNING \$webservergroup is set to an empty string. "WARNING \$webservergroup is set to an empty string.
That is a very insecure practice. Please refer to the That is a very insecure practice. Please refer to the
...@@ -116,8 +118,9 @@ Check the AddHandler statement in your httpd.conf file.\n"; ...@@ -116,8 +118,9 @@ Check the AddHandler statement in your httpd.conf file.\n";
} }
# Make sure that webserver is honoring .htaccess files # Make sure that webserver is honoring .htaccess files
$::localconfig =~ s~^\./~~; my $localconfig = bz_locations()->{'localconfig'};
$url = $ARGV[0] . "/$::localconfig"; $localconfig =~ s~^\./~~;
$url = $ARGV[0] . "/$localconfig";
$response = fetch($url); $response = fetch($url);
if ($response) { if ($response) {
print print
......
...@@ -32,23 +32,17 @@ use lib qw(.); ...@@ -32,23 +32,17 @@ use lib qw(.);
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Token;
use Bugzilla::User;
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $template = Bugzilla->template; my $template = Bugzilla->template;
my $vars = {}; my $vars = {};
# Include the Bugzilla CGI and general utility library.
require "globals.pl";
Bugzilla->login(LOGIN_OPTIONAL); 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 # Data Validation / Security Authorization
################################################################################ ################################################################################
......
...@@ -28,12 +28,12 @@ use lib qw(.); ...@@ -28,12 +28,12 @@ use lib qw(.);
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Search; use Bugzilla::Search;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::User; use Bugzilla::User;
require "globals.pl";
my $template = Bugzilla->template; my $template = Bugzilla->template;
my $vars = {}; my $vars = {};
......
...@@ -29,12 +29,13 @@ use lib "."; ...@@ -29,12 +29,13 @@ use lib ".";
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Bug; use Bugzilla::Bug;
use Bugzilla::User; use Bugzilla::User;
use Bugzilla::Product; use Bugzilla::Product;
require "globals.pl";
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template; my $template = Bugzilla->template;
my $vars = {}; my $vars = {};
......
...@@ -27,10 +27,9 @@ ...@@ -27,10 +27,9 @@
use strict; use strict;
use lib "."; use lib ".";
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Search; use Bugzilla::Search;
use Bugzilla::User; use Bugzilla::User;
...@@ -106,7 +105,7 @@ if ($fromaddress !~ Param('emailregexp')) { ...@@ -106,7 +105,7 @@ if ($fromaddress !~ Param('emailregexp')) {
# Check the nomail file for users who should not receive mail # Check the nomail file for users who should not receive mail
my %nomail; my %nomail;
if (open(NOMAIL, '<', "$datadir/nomail")) { if (open(NOMAIL, '<', bz_locations()->{'datadir'} . "/nomail")) {
while (<NOMAIL>) { while (<NOMAIL>) {
$nomail{trim($_)} = 1; $nomail{trim($_)} = 1;
} }
......
...@@ -30,9 +30,8 @@ ...@@ -30,9 +30,8 @@
use strict; use strict;
use lib '.'; use lib '.';
require "globals.pl";
use Bugzilla; use Bugzilla;
use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Mailer; use Bugzilla::Mailer;
use Bugzilla::Util; use Bugzilla::Util;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment