Skip to content
Permalink
Browse files

don't allow streamplugins without non-free graphs lib

Signed-off-by: lachlan <lachlan.00@gmail.com>
  • Loading branch information
lachlan-00 committed Feb 10, 2020
1 parent 523510b commit 8b1c865862d28fd67c5567d4b3946ea396840204
@@ -24,6 +24,11 @@ class Graph
{
public function __construct()
{
if (!AmpConfig::get('statistical_graphs') || !is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) {
debug_event('graph', 'Access denied, statistical graph disabled.', 1);

return false;
}
require_once AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/Data.php';
require_once AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/Draw.php';
require_once AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/Image.php';
@@ -534,7 +539,7 @@ public static function display_from_request()
require_once AmpConfig::get('prefix') . UI::find_template('show_graphs.inc.php');
}
}
} // end graph.class
}

// Need to create a function to pass to pGraph objects
function pGraph_Yformat_bytes($value)
@@ -94,6 +94,12 @@ public function stream_control($media_ids)
if ($this->bandwidth_max < 0) {
return true;
}
// if using free software only you can't use this plugin
if (!AmpConfig::get('statistical_graphs') || !is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) {
debug_event('streambandwidth.plugin', 'Access denied, statistical graph disabled.', 1);

return true;
}

// Calculate all media size
$next_total = 0;
@@ -94,6 +94,12 @@ public function stream_control($media_ids)
if ($this->hits_max < 0) {
return true;
}
// if using free software only you can't use this plugin
if (!AmpConfig::get('statistical_graphs') || !is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) {
debug_event('streamhits.plugin', 'Access denied, statistical graph disabled.', 1);

return true;
}

$next_total = count($media_ids);

@@ -94,6 +94,12 @@ public function stream_control($media_ids)
if ($this->time_max < 0) {
return true;
}
// if using free software only you can't use this plugin
if (!AmpConfig::get('statistical_graphs') || !is_dir(AmpConfig::get('prefix') . '/lib/vendor/szymach/c-pchart/src/Chart/')) {
debug_event('streamtime.plugin', 'Access denied, statistical graph disabled.', 1);

return true;
}

// Calculate all media time
$next_total = 0;

0 comments on commit 8b1c865

Please sign in to comment.
You can’t perform that action at this time.