diff options
| author | onefang | 2019-12-10 14:05:36 +1000 |
|---|---|---|
| committer | onefang | 2019-12-10 14:05:36 +1000 |
| commit | fe73abc4ee41989d40b6bec0dbee1391470f97e6 (patch) | |
| tree | b4e6f678194fcfee5ee5fa009213320012d2fefc /inc/functions.inc.php | |
| parent | A few style tweaks, mostly to a dark theme. (diff) | |
| download | apt-panopticon_cgp-fe73abc4ee41989d40b6bec0dbee1391470f97e6.zip apt-panopticon_cgp-fe73abc4ee41989d40b6bec0dbee1391470f97e6.tar.gz apt-panopticon_cgp-fe73abc4ee41989d40b6bec0dbee1391470f97e6.tar.bz2 apt-panopticon_cgp-fe73abc4ee41989d40b6bec0dbee1391470f97e6.tar.xz | |
New config for "allowed" graphs, so people can hide some of them.
Diffstat (limited to '')
| -rw-r--r-- | inc/functions.inc.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/inc/functions.inc.php b/inc/functions.inc.php index 376b6e1..1c12c2f 100644 --- a/inc/functions.inc.php +++ b/inc/functions.inc.php | |||
| @@ -1,8 +1,11 @@ | |||
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | require_once 'conf/common.inc.php'; | ||
| 4 | |||
| 3 | # global functions | 5 | # global functions |
| 4 | 6 | ||
| 5 | function GET($index = NULL, $value = NULL) { | 7 | function GET($index = NULL, $value = NULL) { |
| 8 | global $CONFIG; | ||
| 6 | # parse all values from $_GET when no index is given | 9 | # parse all values from $_GET when no index is given |
| 7 | if ($index === NULL) { | 10 | if ($index === NULL) { |
| 8 | $arr = array(); | 11 | $arr = array(); |
| @@ -40,6 +43,9 @@ function GET($index = NULL, $value = NULL) { | |||
| 40 | } | 43 | } |
| 41 | break; | 44 | break; |
| 42 | case 'p': # plugin | 45 | case 'p': # plugin |
| 46 | if ((!in_array($value, $CONFIG['allowed'])) && (!in_array($value, $CONFIG['overview']))) { | ||
| 47 | return NULL; | ||
| 48 | } | ||
| 43 | case 'c': # category | 49 | case 'c': # category |
| 44 | case 't': # type | 50 | case 't': # type |
| 45 | if (!preg_match('/^\w+$/u', $value)) { | 51 | if (!preg_match('/^\w+$/u', $value)) { |
