From a2dd3b00284fd4724d3408274cb1156c7a77d187 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sat, 24 Oct 2009 05:21:06 +0000 Subject: Bug 520948: Use Bugzilla->feature and feature_enabled everywhere instead of checking if modules are installed Patch by Max Kanat-Alexander r=LpSolit, a=LpSolit --- reports.cgi | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'reports.cgi') diff --git a/reports.cgi b/reports.cgi index 6eb4496cc..b53d9521e 100755 --- a/reports.cgi +++ b/reports.cgi @@ -45,19 +45,18 @@ use Bugzilla::Util; use Bugzilla::Error; use Bugzilla::Status; -eval "use GD"; -$@ && ThrowCodeError("gd_not_installed"); -eval "use Chart::Lines"; -$@ && ThrowCodeError("chart_lines_not_installed"); +# 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(); + +if (!Bugzilla->feature('old_charts')) { + ThrowCodeError('feature_disabled', { feature => 'old_charts' }); +} my $dir = bz_locations()->{'datadir'} . "/mining"; my $graph_url = 'graphs'; my $graph_dir = bz_locations()->{'libpath'} . '/' .$graph_url; -# 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(); - Bugzilla->switch_to_shadow_db(); my $cgi = Bugzilla->cgi; -- cgit v1.2.3-24-g4f1b