mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
More updates
This commit is contained in:
@@ -625,4 +625,7 @@ $config['ipmi']['type'][] = "lan";
|
||||
$config['ipmi']['type'][] = "imb";
|
||||
$config['ipmi']['type'][] = "open";
|
||||
|
||||
// Options needed for dyn config - do NOT edit
|
||||
$dyn_config['email_backend'] = array('mail','sendmail','smtp');
|
||||
$dyn_config['email_smtp_secure'] = array('', 'tls', 'ssl');
|
||||
?>
|
||||
|
||||
@@ -14,29 +14,27 @@ if (!$database_link)
|
||||
$database_db = mysql_select_db($config['db_name'], $database_link);
|
||||
|
||||
function mergecnf($obj) {
|
||||
global $config;
|
||||
$pointer = array();
|
||||
$val = $obj['config_value'];
|
||||
$obj = $obj['config_name'];
|
||||
$obj = explode('.',$obj);
|
||||
$str = "";
|
||||
foreach ($obj as $sub) {
|
||||
if (!empty($sub)) {
|
||||
$str .= "['".addslashes($sub)."']";
|
||||
$obj = explode('.',$obj,2);
|
||||
if (!isset($obj[1])) {
|
||||
if (filter_var($val,FILTER_VALIDATE_INT)) {
|
||||
$val = (int) $val;
|
||||
} elseif (filter_var($val,FILTER_VALIDATE_FLOAT)) {
|
||||
$val = (float) $val;
|
||||
} elseif (filter_var($val,FILTER_VALIDATE_BOOLEAN)) {
|
||||
$val =(boolean) $val;
|
||||
}
|
||||
if (!empty($obj[0])) {
|
||||
return array($obj[0] => $val);
|
||||
} else {
|
||||
$str .= "[]";
|
||||
return array($val);
|
||||
}
|
||||
}
|
||||
$str = '$config'.$str.' = ';
|
||||
if (filter_var($val,FILTER_VALIDATE_INT)) {
|
||||
$str .= "(int) '$val';";
|
||||
} elseif (filter_var($val,FILTER_VALIDATE_FLOAT)) {
|
||||
$str .= "(float) '$val';";
|
||||
} elseif (filter_var($val,FILTER_VALIDATE_BOOLEAN)) {
|
||||
$str .= "(boolean) '$val';";
|
||||
} else {
|
||||
$str .= "'$val';";
|
||||
$pointer[$obj[0]] = mergecnf(array('config_name'=>$obj[1],'config_value'=>$val));
|
||||
}
|
||||
eval('return array('.$str.')');
|
||||
return $pointer;
|
||||
}
|
||||
|
||||
foreach( dbFetchRows('select config_name,config_value from config') as $obj ) {
|
||||
|
||||
@@ -28,7 +28,6 @@ include_once($config['install_dir'] . "/includes/syslog.php");
|
||||
include_once($config['install_dir'] . "/includes/rewrites.php");
|
||||
include_once($config['install_dir'] . "/includes/snmp.inc.php");
|
||||
include_once($config['install_dir'] . "/includes/services.inc.php");
|
||||
echo $config['install_dir'] . "/includes/console_colour.php";
|
||||
include_once($config['install_dir'] . "/includes/console_colour.php");
|
||||
|
||||
$console_color = new Console_Color2();
|
||||
|
||||
Reference in New Issue
Block a user