Commit 8e7c07a1 authored by gerv%gerv.net's avatar gerv%gerv.net

Bug 6682: moving location of graph creation dir to graphs instead of…

Bug 6682: moving location of graph creation dir to graphs instead of data/mining, for security reasons.
parent a1e8485e
...@@ -32,10 +32,10 @@ use vars @::legal_product; ...@@ -32,10 +32,10 @@ use vars @::legal_product;
require "globals.pl"; require "globals.pl";
# tidy up after graphing module # tidy up after graphing module
chdir("data/mining"); chdir("graphs");
unlink <*.gif>; unlink <./*.gif>;
unlink <*.png>; unlink <./*.png>;
chdir("../.."); chdir("..");
ConnectToDatabase(1); ConnectToDatabase(1);
GetVersionTable(); GetVersionTable();
......
...@@ -49,6 +49,7 @@ require "globals.pl"; ...@@ -49,6 +49,7 @@ require "globals.pl";
use vars qw(@legal_product); # globals from er, globals.pl use vars qw(@legal_product); # globals from er, globals.pl
my $dir = "data/mining"; my $dir = "data/mining";
my $graph_dir = "graphs";
my @status = qw (NEW ASSIGNED REOPENED); my @status = qw (NEW ASSIGNED REOPENED);
my %bugsperperson; my %bugsperperson;
...@@ -500,10 +501,10 @@ FIN ...@@ -500,10 +501,10 @@ FIN
my $type = chart_image_type(); my $type = chart_image_type();
my $data_file = daily_stats_filename($FORM{product}); my $data_file = daily_stats_filename($FORM{product});
my $image_file = chart_image_name($data_file, $type); my $image_file = chart_image_name($data_file, $type);
my $url_image = "$dir/" . url_quote($image_file); my $url_image = "$graph_dir/" . url_quote($image_file);
if (! -e "$dir/$image_file") { if (! -e "$graph_dir/$image_file") {
generate_chart("$dir/$data_file", "$dir/$image_file", $type); generate_chart("$dir/$data_file", "$graph_dir/$image_file", $type);
} }
print <<FIN; print <<FIN;
...@@ -586,7 +587,7 @@ sub generate_chart { ...@@ -586,7 +587,7 @@ sub generate_chart {
if (! defined $line[$i] or $line[$i] eq '') { if (! defined $line[$i] or $line[$i] eq '') {
# no data point given, don't plot (this will probably # no data point given, don't plot (this will probably
# generate loads of Chart::Base warnings, but that's not # generate loads of Chart::Base warnings, but that's not
# our fault. # our fault.)
push @{$data{$field}}, undef; push @{$data{$field}}, undef;
} }
else { else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment