aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/graph.php
blob: 37e442a3b4f94ec9888b8d2f89fb9e4548596c91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

require_once 'conf/common.inc.php';
require_once 'inc/functions.inc.php';

$plugin = validate_get(GET('p'), 'plugin');
$width = empty($_GET['x']) ? $CONFIG['width'] : $_GET['x'];
$height = empty($_GET['y']) ? $CONFIG['height'] : $_GET['y'];

if (validate_get(GET('h'), 'host') === NULL) {
	error_log('CGP Error: plugin contains unknown characters');
	error_image();
}

if (!file_exists($CONFIG['webdir'].'/plugin/'.$plugin.'.php')) {
	error_log(sprintf('CGP Error: plugin "%s" is not available', $plugin));
	error_image();
}

# load plugin
include $CONFIG['webdir'].'/plugin/'.$plugin.'.php';


?>