=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);
# 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+";
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
################################################################################
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;
{
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];
}
#
# 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')
$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(
}
$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',
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.
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;
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;
# 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';
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;
# 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
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;
use Bugzilla;
use Bugzilla::Constants;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Error;
use Bugzilla::User;
use Bugzilla::Keyword;
-require "globals.pl";
Bugzilla->login();
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;
$regenerate = 1;
}
+my $datadir = bz_locations()->{'datadir'};
+
my @myproducts = map {$_->name} Bugzilla::Product::get_all_products();
unshift(@myproducts, "-All-");
my $dir = "$datadir/mining";
&check_data_dir ($dir);
-
+
if ($regenerate) {
®enerate_stats($dir, $_);
} else {
# 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;
# 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;
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";
#
# 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)
# - 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
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;
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" );
# 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";
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;
# 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";
# 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"; }
+ }
}
}
return("");
}
-# This routine was copied from globals.pl which was largely copied
-# from Mysql.pm.
sub detaint_string {
my ($str) = @_;
$str =~ m/^(.*)$/s;
#
# 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.
use lib qw(.);
-require "globals.pl";
use Bugzilla;
+use Bugzilla::Config qw(:DEFAULT);
+use Bugzilla::Util;
use Bugzilla::BugMail;
use Bugzilla::User;
use lib qw(.);
-require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::BugMail;
#
# 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;
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;
use strict;
use lib ".";
-require "globals.pl";
use Bugzilla;
use Bugzilla::Field;
use Bugzilla;
use Bugzilla::Constants;
-require "globals.pl";
+use Bugzilla::Util;
+use Bugzilla::Error;
use Bugzilla::Product;
my $user = Bugzilla->login();
use lib ".";
use Bugzilla;
+use Bugzilla::Error;
use Bugzilla::User;
-require "globals.pl";
-
Bugzilla->login();
my $cgi = Bugzilla->cgi;
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;
use Errno;
use Fcntl;
+my $datadir = bz_locations()->{'datadir'};
+
if (!tie(%dbmcount, 'AnyDBM_File', "$datadir/duplicates/dupes$today",
O_RDONLY, 0644)) {
if ($!{ENOENT}) {
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;
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;
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;
use Bugzilla::FlagType;
use Bugzilla::Group;
use Bugzilla::Util;
+use Bugzilla::Error;
use Bugzilla::Product;
use Bugzilla::Component;
use Bugzilla::Bug;
# 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;
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;
# 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;
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);
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;
use Bugzilla;
use Bugzilla::Constants;
+use Bugzilla::Util;
+use Bugzilla::Error;
use Bugzilla::User::Setting;
-require "globals.pl";
-
my $template = Bugzilla->template;
my $vars = {};
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;
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
# 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;
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);
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;
use Bugzilla::Keyword;
use Bugzilla::Token;
use Bugzilla::Field;
-require "globals.pl";
my $user = Bugzilla->login(LOGIN_REQUIRED);
+++ /dev/null
-# -*- 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;
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;
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);
# 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
use lib ".";
use Bugzilla;
-
-require "globals.pl";
+use Bugzilla::Error;
Bugzilla->login();
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;
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;
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;
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);
use strict;
use lib qw(.);
-require "globals.pl";
-
use Bugzilla;
use Bugzilla::Mailer;
use Bugzilla::Constants;
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;
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();
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;
use lib qw(.);
-require "globals.pl";
-
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Util;
+use Bugzilla::Error;
use Bugzilla::User;
###########################################################################
use lib qw(.);
-require "globals.pl";
-
use Bugzilla;
+use Bugzilla::Error;
use Bugzilla::Bug;
my $cgi = Bugzilla->cgi;
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;
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;
}
my $rankdir = $cgi->param('rankdir') || "LR";
+my $webdotdir = bz_locations()->{'webdotdir'};
if (!defined $cgi->param('id') && !defined $cgi->param('doall')) {
ThrowCodeError("missing_bug_id");
use strict;
use lib qw(.);
-require "globals.pl";
+
use Bugzilla;
+use Bugzilla::Error;
use Bugzilla::Bug;
my $user = Bugzilla->login();
use strict;
use lib ".";
-require "globals.pl";
use Bugzilla;
+use Bugzilla::Error;
Bugzilla->login();
my $cgi = Bugzilla->cgi;
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 = {};
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);
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",
# issues as possible.
use strict;
+use lib ".";
BEGIN {
my $envpath = $ENV{'PATH'};
$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;
# 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
}
# 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
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
################################################################################
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 = {};
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 = {};
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;
# 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;
}
use strict;
use lib '.';
-require "globals.pl";
-
use Bugzilla;
+use Bugzilla::Config qw(:DEFAULT);
use Bugzilla::Mailer;
use Bugzilla::Util;