forked from howardjones/network-weathermap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cacti-pick.php
33 lines (26 loc) · 886 Bytes
/
cacti-pick.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* Weathermap 0.98
*
* cacti-pick.php - data-source selector for the editor
*
*/
// ******************************************
// sensible defaults
$cacti_base = '../../';
$cacti_base = '/var/www/html/ni_cacti';
$config['base_url'] = $cacti_url;
if (file_exists("editor-config.php")) {
include_once 'editor-config.php';
}
require_once dirname(__FILE__).'/lib/SimpleTemplate.class.php';
require_once "lib/cacti-pick.php";
// Load Cacti's config, so we can get the database details
if (is_dir($cacti_base) && file_exists($cacti_base."/include/global.php")) {
// include the cacti-config, so we know about the database
include_once $cacti_base."/include/global.php";
$config['base_url'] = (isset($config['url_path'])? $config['url_path'] : $cacti_url);
} else {
throw new Exception("Can't run Cacti Picker without Cacti");
}
pickerDispatch($_GET);