From f7142c031ef7f563fd335041f593f39b68f6be59 Mon Sep 17 00:00:00 2001 From: Per Qvarforth Date: Tue, 2 Aug 2022 16:00:46 +0000 Subject: [PATCH] heatmap write access --- README.md | 3 ++- htdocs/public/heatmaps/heatmap.php | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8310cf2..c04d4f6 100644 --- a/README.md +++ b/README.md @@ -206,9 +206,10 @@ sudo a2enmod rewrite sudo systemctl restart apache2 ``` -For the symbols cache to work we need to make sure the webserver has write access to our htdocs/public/symbols directory (the following permission may be a little bit too generous...) +For the symbols and heatmap caches to work we need to make sure the webserver has write access (the following permission may be a little bit too generous...) ``` chmod 777 ~/trackdirect/htdocs/public/symbols +chmod 777 ~/trackdirect/htdocs/public/heatmaps ``` If you have enabled a firewall, make sure port 80 is open. diff --git a/htdocs/public/heatmaps/heatmap.php b/htdocs/public/heatmaps/heatmap.php index 37db43d..7e7a539 100755 --- a/htdocs/public/heatmaps/heatmap.php +++ b/htdocs/public/heatmaps/heatmap.php @@ -77,7 +77,10 @@ $config = array( ); $heatmap = new gd_heatmap($data, $config); -//$heatmap->output(); -$heatmap->output($filename); -readfile($filename); +if (is_writable(dirname($filename))) { + $heatmap->output($filename); + readfile($filename); +} else { + $heatmap->output(); +}