package Bugzilla::Attachment;
-# This module requires that its caller have said "require CGI.pl" to import
-# relevant functions from that script and its companion globals.pl.
+# This module requires that its caller have said "require globals.pl" to import
+# relevant functions from that script.
# Use the Flag module to handle flags.
use Bugzilla::Flag;
=item *
Prior to calling routines in this module, it's assumed that you have
-already done a C<require CGI.pl>. This will eventually change in a
-future version when CGI.pl is removed.
+already done a C<require globals.pl>.
=item *
-Import relevant functions from that script and its companion globals.pl.
+Import relevant functions from that script.
=item *
=item *
Prior to calling routines in this module, it's assumed that you have
-already done a C<require CGI.pl>. This will eventually change in a
-future version when CGI.pl is removed.
+already done a C<require globals.pl>.
=item *
use strict;
-# The caller MUST require CGI.pl and globals.pl before using this
+# The caller MUST require globals.pl before using this module.
use vars qw($userid);
use Date::Format;
use Date::Parse;
-# This module requires that its caller have said "require CGI.pl" to import
-# relevant functions from that script and its companion globals.pl.
+# This module requires that its caller have said "require globals.pl" to import
+# relevant functions from that script.
################################################################################
# Constants
+++ /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>
-# Joe Robins <jmrobins@tgix.com>
-# Dave Miller <justdave@syndicomm.com>
-# Christopher Aillon <christopher@aillon.com>
-# Gervase Markham <gerv@gerv.net>
-# Christian Reis <kiko@async.com.br>
-
-# Contains some global routines used throughout the CGI scripts of Bugzilla.
-
-use strict;
-use lib ".";
-
-# use Carp; # for confess
-
-use Bugzilla::Util;
-use Bugzilla::Config;
-use Bugzilla::Constants;
-use Bugzilla::Error;
-use Bugzilla::BugMail;
-use Bugzilla::Bug;
-use Bugzilla::User;
-
-# Shut up misguided -w warnings about "used only once". For some reason,
-# "use vars" chokes on me when I try it here.
-
-sub CGI_pl_sillyness {
- my $zz;
- $zz = $::buffer;
-}
-
-require 'globals.pl';
-
-use vars qw($vars);
-
-############# Live code below here (that is, not subroutine defs) #############
-
-use Bugzilla;
-
-# XXX - mod_perl - reset this between runs
-$::cgi = Bugzilla->cgi;
-
-$::buffer = $::cgi->query_string();
-
-# This could be needed in any CGI, so we set it here.
-$vars->{'help'} = $::cgi->param('help') ? 1 : 0;
-
-1;
use lib qw(.);
-use vars qw(
- $template
- $vars
-);
+use vars qw($template $vars);
# Include the Bugzilla CGI and general utility library.
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Config qw(:locations);
# Use these modules to handle flags.
# Happens when calling plain attachment.cgi from the urlbar directly
if ($param eq 'id' && !$cgi->param('id')) {
- print Bugzilla->cgi->header();
+ print $cgi->header();
$template->process("attachment/choose.html.tmpl", $vars) ||
ThrowTemplateError($template->error());
exit;
$filename =~ s/\\/\\\\/g; # escape backslashes
$filename =~ s/"/\\"/g; # escape quotes
- print Bugzilla->cgi->header(-type=>"$contenttype; name=\"$filename\"",
- -content_disposition=> "inline; filename=\"$filename\"",
- -content_length => $filesize);
+ print $cgi->header(-type=>"$contenttype; name=\"$filename\"",
+ -content_disposition=> "inline; filename=\"$filename\"",
+ -content_length => $filesize);
if ($thedata) {
print $thedata;
require PatchReader::DiffPrinter::raw;
$last_reader->sends_data_to(new PatchReader::DiffPrinter::raw());
# Actually print out the patch
- use vars qw($cgi);
print $cgi->header(-type => 'text/plain',
-expires => '+3M');
$reader->iterate_string("Attachment $attach_id", $thedata);
$vars->{'bugsummary'} = $bugsummary;
$vars->{'GetBugLink'} = \&GetBugLink;
- print Bugzilla->cgi->header();
+ print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/show-multiple.html.tmpl", $vars)
$vars->{'any_flags_requesteeble'} = grep($_->{'is_requesteeble'},
@$flag_types);
- print Bugzilla->cgi->header();
+ print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/create.html.tmpl", $vars)
$vars->{'contenttypemethod'} = $cgi->param('contenttypemethod');
$vars->{'contenttype'} = $cgi->param('contenttype');
- print Bugzilla->cgi->header();
+ print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/created.html.tmpl", $vars)
require PatchReader;
$vars->{'patchviewerinstalled'} = 1;
};
- print Bugzilla->cgi->header();
+ print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/edit.html.tmpl", $vars)
$vars->{'attachid'} = $attach_id;
$vars->{'bugid'} = $bugid;
- print Bugzilla->cgi->header();
+ print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/updated.html.tmpl", $vars)
use Bugzilla::User;
# Include the Bugzilla CGI and general utility library.
-require "CGI.pl";
+require "globals.pl";
use vars qw($db_name
@components
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $buffer = $cgi->query_string();
-if (length($::buffer) == 0) {
+if (length($buffer) == 0) {
print $cgi->header(-refresh=> '10; URL=query.cgi');
ThrowUserError("buglist_parameters_required");
}
});
}
-if ($::buffer =~ /&cmd-/) {
- my $url = "query.cgi?$::buffer#chart";
+if ($buffer =~ /&cmd-/) {
+ my $url = "query.cgi?$buffer#chart";
print $cgi->redirect(-location => $url);
# Generate and return the UI (HTML page) from the appropriate template.
$vars->{'message'} = "buglist_adding_field";
# Take appropriate action based on user's request.
if ($cgi->param('cmdtype') eq "dorem") {
if ($cgi->param('remaction') eq "run") {
- $::buffer = LookupNamedQuery(scalar $cgi->param("namedcmd"));
+ $buffer = LookupNamedQuery(scalar $cgi->param("namedcmd"));
$vars->{'searchname'} = $cgi->param('namedcmd');
$vars->{'searchtype'} = "saved";
- $params = new Bugzilla::CGI($::buffer);
+ $params = new Bugzilla::CGI($buffer);
$order = $params->param('order') || $order;
}
elsif ($cgi->param('remaction') eq "runseries") {
- $::buffer = LookupSeries(scalar $cgi->param("series_id"));
+ $buffer = LookupSeries(scalar $cgi->param("series_id"));
$vars->{'searchname'} = $cgi->param('namedcmd');
$vars->{'searchtype'} = "series";
- $params = new Bugzilla::CGI($::buffer);
+ $params = new Bugzilla::CGI($buffer);
$order = $params->param('order') || $order;
}
elsif ($cgi->param('remaction') eq "forget") {
elsif (($cgi->param('cmdtype') eq "doit") && defined $cgi->param('remtype')) {
if ($cgi->param('remtype') eq "asdefault") {
Bugzilla->login(LOGIN_REQUIRED);
- InsertNamedQuery(Bugzilla->user->id, DEFAULT_QUERY_NAME, $::buffer);
+ InsertNamedQuery(Bugzilla->user->id, DEFAULT_QUERY_NAME, $buffer);
$vars->{'message'} = "buglist_new_default_query";
}
elsif ($cgi->param('remtype') eq "asnamed") {
# form - see bug 252295
if (!$params->param('query_format')) {
$params->param('query_format', 'advanced');
- $::buffer = $params->query_string;
+ $buffer = $params->query_string;
}
################################################################################
# buffer that was created when we initially parsed the URL on script startup,
# then we remove all non-query fields from it, f.e. the sort order (order)
# and command type (cmdtype) fields.
-$vars->{'urlquerypart'} = $::buffer;
+$vars->{'urlquerypart'} = $buffer;
$vars->{'urlquerypart'} =~ s/(order|cmdtype)=[^&]*&?//g;
$vars->{'order'} = $order;
use strict;
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
+use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Chart;
use Bugzilla::Series;
use Bugzilla::User;
-use vars qw($cgi $template $vars);
+use vars qw($vars);
+
+my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
# Go back to query.cgi if we are adding a boolean chart parameter.
if (grep(/^cmd-/, $cgi->param())) {
exit;
}
-my $template = Bugzilla->template;
my $action = $cgi->param('action');
my $series_id = $cgi->param('series_id');
use vars qw(
@legal_keywords
- $buffer
$template
$vars
);
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
Bugzilla->login();
$vars->{'collist'} = \@collist;
$vars->{'splitheader'} = $cgi->cookie('SPLITHEADER') ? 1 : 0;
-$vars->{'buffer'} = $::buffer;
+$vars->{'buffer'} = $cgi->query_string();
# Generate and return the UI (HTML page) from the appropriate template.
print $cgi->header();
# Include the Bugzilla CGI and general utility library.
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
# Retrieve this installation's configuration.
GetVersionTable();
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Constants;
use Bugzilla::BugMail;
use strict;
-require "CGI.pl";
+require "globals.pl";
use lib qw(.);
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla;
use Bugzilla::Constants;
-require "CGI.pl";
+require "globals.pl";
use vars qw($vars @legal_product);
use Bugzilla;
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
# Use the global template variables.
use vars qw($vars $template);
use Bugzilla::Config qw(:DEFAULT :admin $datadir);
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
Bugzilla->login(LOGIN_REQUIRED);
use lib qw(.);
require "globals.pl";
-require "CGI.pl";
use Bugzilla;
use Bugzilla::Search;
use strict;
use lib ".";
-require "CGI.pl";
require "globals.pl";
use Bugzilla::Constants;
use Bugzilla::Series;
use Bugzilla::Util;
use Bugzilla::User;
+use Bugzilla::Bug;
use vars qw($template $vars);
use lib ".";
# Include the Bugzilla CGI and general utility library.
-require "CGI.pl";
+require "globals.pl";
# Use Bugzilla's flag modules for handling flag types.
use Bugzilla;
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
use strict;
use lib ".";
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT $datadir);
use strict;
use lib ".";
-require "CGI.pl";
require "globals.pl";
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT :admin);
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
Bugzilla->login(LOGIN_REQUIRED);
use lib ".";
use vars qw ($template $vars);
use Bugzilla::Constants;
-require "CGI.pl";
require "globals.pl";
use Bugzilla::Bug;
use Bugzilla::Series;
use Bugzilla::User;
use Bugzilla::User::Setting;
-require "CGI.pl";
+require "globals.pl";
# Use global template variables.
use vars qw($template $vars);
use strict;
use lib ".";
-require "CGI.pl";
require "globals.pl";
use vars qw( $vars );
use strict;
use lib ".";
-require "CGI.pl";
require "globals.pl";
use Bugzilla::Constants;
use strict;
use lib ".";
-require "CGI.pl";
require "globals.pl";
use vars qw( $vars );
use Bugzilla::Constants;
use Bugzilla::Bug;
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
use vars qw(
$template
use Bugzilla::Config qw(:DEFAULT ChmodDataFile $localconfig $datadir);
use Bugzilla::BugMail;
use Bugzilla::User;
+use Bugzilla::Error;
# Shut up misguided -w warnings about "used only once". For some reason,
# "use vars" chokes on me when I try it here.
use Bugzilla::BugMail;
use Bugzilla::User;
-require "CGI.pl";
require "globals.pl";
GetVersionTable();
# Include the Bugzilla CGI and general utility library.
use lib ".";
-require "CGI.pl";
+require "globals.pl";
-use vars qw(
- $vars
-);
+use vars qw($vars);
# Check whether or not the user is logged in and, if so, set the $::userid
use Bugzilla::Constants;
use strict;
use lib qw(.);
+use Bugzilla;
-require "CGI.pl";
-
-our $cgi;
+my $cgi = Bugzilla->cgi;
# Convert comma/space separated elements into separate params
my @ids = ();
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use vars qw($template $userid);
use Bugzilla;
-require "CGI.pl";
+require "globals.pl";
use vars qw($template $vars);
use strict;
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Bug;
# "use vars" chokes on me when I try it here.
sub sillyness {
my $zz;
- $zz = $::buffer;
$zz = %::components;
$zz = %::versions;
$zz = @::legal_opsys;
use vars qw($vars $template);
my $user = Bugzilla->login(LOGIN_REQUIRED);
-
my $cgi = Bugzilla->cgi;
-
my $dbh = Bugzilla->dbh;
# do a match on the fields if applicable
}
if (defined $cgi->param('maketemplate')) {
- $vars->{'url'} = $::buffer;
+ $vars->{'url'} = $cgi->query_string();
print $cgi->header();
$template->process("bug/create/make-template.html.tmpl", $vars)
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Bug;
use strict;
use lib ".";
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Constants;
use Bugzilla::Search;
use Bugzilla::Util;
use vars qw(
- @CheckOptionValues
@legal_resolution
@legal_bug_status
@legal_components
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $buffer = $cgi->query_string();
if ($cgi->param("GoAheadAndLogIn")) {
# We got here from a login page, probably from relogin.cgi. We better
" WHERE userid = ? AND name = ?",
undef, ($userid, DEFAULT_QUERY_NAME));
}
- $::buffer = "";
+ $buffer = "";
}
my $userdefaultquery;
}
-if (!PrefillForm($::buffer)) {
+if (!PrefillForm($buffer)) {
# Ah-hah, there was no form stuff specified. Do it again with the
# default query.
if ($userdefaultquery) {
use strict;
-use vars qw(
- $userid
- $template
- $vars
-);
+use vars qw($userid $template $vars);
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Constants;
use strict;
-use vars qw($template $vars);
-
use lib qw(.);
-
-require "CGI.pl";
+use Bugzilla;
+use Bugzilla::Error;
# We don't want to remove a random logincookie from the db, so
# call Bugzilla->login(). If we're logged in after this, then
Bugzilla->logout();
+my $template = Bugzilla->template;
my $cgi = Bugzilla->cgi;
print $cgi->header();
+my $vars = {};
$vars->{'message'} = "logged_out";
$template->process("global/message.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
use strict;
use lib ".";
-require "CGI.pl";
+require "globals.pl";
use vars qw($template $vars @legal_opsys @legal_platform @legal_severity);
use Bugzilla::Constants;
my $cgi = Bugzilla->cgi;
+my $buffer = $cgi->query_string();
# Go straight back to query.cgi if we are adding a boolean chart.
if (grep(/^cmd-/, $cgi->param())) {
# We need to keep track of the defined restrictions on each of the
# axes, because buglistbase, below, throws them away. Without this, we
# get buglistlinks wrong if there is a restriction on an axis field.
- $vars->{'col_vals'} = join("&", $::buffer =~ /[&?]($col_field=[^&]+)/g);
- $vars->{'row_vals'} = join("&", $::buffer =~ /[&?]($row_field=[^&]+)/g);
- $vars->{'tbl_vals'} = join("&", $::buffer =~ /[&?]($tbl_field=[^&]+)/g);
+ $vars->{'col_vals'} = join("&", $buffer =~ /[&?]($col_field=[^&]+)/g);
+ $vars->{'row_vals'} = join("&", $buffer =~ /[&?]($row_field=[^&]+)/g);
+ $vars->{'tbl_vals'} = join("&", $buffer =~ /[&?]($tbl_field=[^&]+)/g);
# We need a number of different variants of the base URL for different
# URLs in the HTML.
use Bugzilla::Config qw(:DEFAULT $datadir);
-require "CGI.pl";
-
require "globals.pl";
use vars qw(@legal_product); # globals from er, globals.pl
# Include the Bugzilla CGI and general utility library.
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
# Use Bugzilla's Request module which contains utilities for handling requests.
use Bugzilla::Flag;
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Constants;
use Bugzilla::User;
use lib qw(.);
use vars qw ($template $vars);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Bug;
$vars->{'bug_id'} = $bug_id;
-print Bugzilla->cgi->header();
+print $cgi->header();
$template->process("bug/activity/show.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
use Bugzilla::Constants;
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
use vars qw($template $vars $userid);
use Bugzilla::BugMail;
use Bugzilla::Bug;
-require "CGI.pl";
+require "globals.pl";
Bugzilla->login();
use strict;
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::User;
use Bugzilla::Bug;
use strict;
use lib ".";
-require "CGI.pl";
+require "globals.pl";
# Shut up "Used Only Once" errors
-use vars qw(
- $template
- $vars
-);
+use vars qw($template $vars);
Bugzilla->login();
use Bugzilla::Util; # trim
use Bugzilla::Constants; # LOGIN_*
use Bugzilla::User; # UserInGroup
-require "CGI.pl";
+require "globals.pl";
GetVersionTable();
[% USE Bugzilla %]
[% cgi = Bugzilla.cgi %]
-[% IF help %]
+[% IF cgi.param("help") %]
[% IF cgi.user_agent("Mozilla/5") %]
<style type="text/css">
.help {
[% USE Bugzilla %]
[% cgi = Bugzilla.cgi %]
-[% IF help %]
+[% IF cgi.param("help") %]
[% IF cgi.user_agent("Mozilla/5") %]
[% FOREACH h = help_html %]
<div id="[% h.id %]_help" class="help" style="display: none;">
[% button_name = "Search" %]
[%# The decent help requires Javascript %]
-[% IF NOT help %]
+[% IF NOT cgi.param("help") %]
[% IF cgi.user_agent("Mozilla/5") %]
<script type="text/javascript"> <!--
document.write("<p><a href='query.cgi?help=1&format=advanced'>Give me some help</a> (reloads page.)</p>");
</form>
-[% PROCESS "search/search-help.html.tmpl" IF help %]
+[% PROCESS "search/search-help.html.tmpl" IF cgi.param("help") %]
[% PROCESS global/footer.html.tmpl %]
my $dbh = Bugzilla->dbh;
# Include the Bugzilla CGI and general utility library.
-require "CGI.pl";
+require "globals.pl";
Bugzilla->login(LOGIN_OPTIONAL);
use Bugzilla::Util;
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
# Use global template variables.
use vars qw($template $vars $userid);
use Bugzilla::Constants;
use Bugzilla::Bug;
-require "CGI.pl";
+require "globals.pl";
# Use global template variables
use vars qw($template $vars);
use strict;
use lib qw(.);
+use Bugzilla;
-require "CGI.pl";
-
-our $cgi;
+my $cgi = Bugzilla->cgi;
# Convert comma/space separated elements into separate params
my @ids = ();