]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 467701: USAGE_MODE_CMDLINE should be the default if not i_am_cgi()
authormkanat%bugzilla.org <>
Tue, 16 Dec 2008 21:16:25 +0000 (21:16 +0000)
committermkanat%bugzilla.org <>
Tue, 16 Dec 2008 21:16:25 +0000 (21:16 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit

Bugzilla.pm
checksetup.pl
collectstats.pl
contrib/bzdbcopy.pl
importxml.pl
sanitycheck.pl

index e80f184ed4ce5b2553df10ace14893d740609a3e..354d051481936b8c8bacdb0b0362629ab0fd9e45 100644 (file)
@@ -372,7 +372,7 @@ sub usage_mode {
         $class->request_cache->{usage_mode} = $newval;
     }
     return $class->request_cache->{usage_mode}
-        || Bugzilla::Constants::USAGE_MODE_BROWSER;
+        || (i_am_cgi()? USAGE_MODE_BROWSER : USAGE_MODE_CMDLINE);
 }
 
 sub installation_mode {
index d7a787f4885ef59fb07c6b7f303069446b7f6f20..74b21dfdac1a62bb7c4c3b2f746e2f84a93ce836 100755 (executable)
@@ -115,7 +115,6 @@ require Bugzilla::Template;
 require Bugzilla::Field;
 require Bugzilla::Install;
 
-Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
 Bugzilla->installation_mode(INSTALLATION_MODE_NON_INTERACTIVE) if $answers_file;
 Bugzilla->installation_answers($answers_file);
 
index 08f1c113167447bfa5a36d847629339f5aae071e..761c648c825613b56e55c8244eb78f607b6eb116 100755 (executable)
@@ -59,9 +59,6 @@ if (chdir("graphs")) {
     chdir($cwd);
 }
 
-# This is a pure command line script.
-Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
-
 my $dbh = Bugzilla->switch_to_shadow_db();
 
 
index eade7568323f504637492343c9b002dc068d64f1..b4f1fffd2ad38e967c9b030dd9eb0c3f4c50b646 100755 (executable)
@@ -48,8 +48,6 @@ use constant TARGET_DB_HOST => 'localhost';
 # MAIN SCRIPT
 #####################################################################
 
-Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
-
 print "Connecting to the '" . SOURCE_DB_NAME . "' source database on " 
       . SOURCE_DB_TYPE . "...\n";
 my $source_db = Bugzilla::DB::_connect(SOURCE_DB_TYPE, SOURCE_DB_HOST, 
index d2ff9cc67527a29dbc3c73650d53ba8fb2ed44d5..fd8c27723de135d9bac13eb925907bdaf03ace27 100755 (executable)
@@ -92,10 +92,6 @@ use Getopt::Long;
 use Pod::Usage;
 use XML::Twig;
 
-# We want to capture errors and handle them here rather than have the Template
-# code barf all over the place.
-Bugzilla->usage_mode(Bugzilla::Constants::USAGE_MODE_CMDLINE);
-
 my $debug = 0;
 my $mail  = '';
 my $attach_path = '';
index 2ef0eea7da29bfcff091c16e41e87c9555a8910f..e0128b58a06cc26745ce515da00fde8cc97272e1 100644 (file)
@@ -42,8 +42,6 @@ my $result = GetOptions('verbose'  => \$verbose,
 
 pod2usage({-verbose => 1, -exitval => 1}) if $help;
 
-Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
-
 # Be sure a login name if given.
 $login || ThrowUserError('invalid_username');