*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; only version 2 of the License is applicable.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
error_reporting(E_ALL | E_NOTICE | E_WARNING);
require('config.php');
require('functions.php');
/**
* Send back new list content
* @items Array of options values to return to browser
* @method Name of Javascript method that will be called to process data
*/
function dhtml_response_list(&$items, $method) {
header("Content-Type: text/xml");
print(''."\n");
print("
Config error: $config["datadirs"] is not an array
'; else if (count($config['datadirs']) == 0) echo 'Config error: $config["datadirs"] is empty
'; else foreach ($config['datadirs'] as $datadir) if (!is_dir($datadir)) echo 'Config error: $config["datadirs"], '.htmlspecialchars($datadir).' does not exist
'; if (!isset($config['rrd_width'])) echo 'Config error: $config["rrd_width"] is not set
'; else if (10 > (int)$config['rrd_width']) echo 'Config error: $config["rrd_width"] is invalid. Integer >= 10 expected
'; if (!isset($config['rrd_height'])) echo 'Config error: $config["rrd_height"] is not set
'; else if (10 > (int)$config['rrd_height']) echo 'Config error: $config["rrd_height"] is invalid. Integer >= 10 expected
'; if (!isset($config['rrd_opts'])) echo 'Config error: $config["rrd_opts"] is not set
'; else if (!is_array($config['rrd_opts'])) echo 'Config error: $config["rrd_opts"] is not an array
'; if (!isset($config['timespan'])) echo 'Config error: $config["timespan"] is not set
'; else if (!is_array($config['timespan'])) echo 'Config error: $config["timespan"] is not an array
'; else if (count($config['timespan']) == 0) echo 'Config error: $config["timespan"] is empty
'; else foreach ($config['timespan'] as &$timespan) if (!is_array($timespan) || !isset($timespan['name']) || !isset($timespan['label']) || !isset($timespan['seconds']) || 10 > (int)$timespan['seconds']) echo 'Config error: $config["timespan"], invalid entry found
'; if (!is_null($config['collectd_sock']) && strncmp('unix://', $config['collectd_sock'], 7) != 0) echo 'Config error: $config["collectd_sock"] is not valid
'; if (!defined('RRDTOOL')) echo 'Config error: RRDTOOL is not defined
'; else if (!is_executable(RRDTOOL)) echo 'Config error: RRDTOOL ('.htmlspecialchars(RRDTOOL).') is not executable
'; ?>