diff options
author | mkanat%bugzilla.org <> | 2009-10-24 05:21:06 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-10-24 05:21:06 +0000 |
commit | a2dd3b00284fd4724d3408274cb1156c7a77d187 (patch) | |
tree | 4aa41a1c8cea9d31aaccddc4685f8f1c5991c1b4 /reports.cgi | |
parent | 401fb65f2e6f9031cedf47fb6d951236b5c624d3 (diff) | |
download | bugs-a2dd3b00284fd4724d3408274cb1156c7a77d187.tar bugs-a2dd3b00284fd4724d3408274cb1156c7a77d187.tar.gz bugs-a2dd3b00284fd4724d3408274cb1156c7a77d187.tar.bz2 bugs-a2dd3b00284fd4724d3408274cb1156c7a77d187.tar.xz bugs-a2dd3b00284fd4724d3408274cb1156c7a77d187.zip |
Bug 520948: Use Bugzilla->feature and feature_enabled everywhere instead of checking if modules are installed
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'reports.cgi')
-rwxr-xr-x | reports.cgi | 15 |
1 files changed, 7 insertions, 8 deletions
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; |