diff --git a/html/form_new_config.php b/html/form_new_config.php
new file mode 100644
index 000000000..6f45a3d6c
--- /dev/null
+++ b/html/form_new_config.php
@@ -0,0 +1,99 @@
+
+ *
+ * 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, either version 3 of the License, or (at your
+ * option) any later version. Please see LICENSE.txt at the top level of
+ * the source code distribution for details.
+ */
+
+enable_debug();
+
+include_once("../includes/defaults.inc.php");
+include_once("../config.php");
+include_once("../includes/definitions.inc.php");
+include_once("includes/functions.inc.php");
+include_once("../includes/functions.php");
+include_once("includes/authenticate.inc.php");
+
+if (!$_SESSION['authenticated']) { echo("unauthenticated"); exit; }
+
+$new_conf_type = $_POST['new_conf_type'];
+$new_conf_name = $_POST['new_conf_name'];
+$new_conf_desc = $_POST['new_conf_desc'];
+
+if(empty($new_conf_name))
+{
+ echo("You haven't specified a config name");
+ exit;
+}
+elseif(empty($new_conf_desc))
+{
+ echo("You haven't specified a config description");
+ exit;
+}
+elseif(empty($_POST['new_conf_single_value']) && empty($_POST['new_conf_multi_value']))
+{
+ echo("You haven't specified a config value");
+ exit;
+}
+
+$db_inserted = '0';
+
+if($new_conf_type == 'Single')
+{
+ $new_conf_type = 'single';
+ $new_conf_value = $_POST['new_conf_single_value'];
+ $db_inserted = add_config_item($new_conf_name,$new_conf_value,$new_conf_type,$new_conf_desc);
+}
+elseif($new_conf_type == 'Single Array')
+{
+ $new_conf_type = 'single-array';
+ $new_conf_value = $_POST['new_conf_single_value'];
+ $db_inserted = add_config_item($new_conf_name,$new_conf_value,$new_conf_type,$new_conf_desc);
+}
+elseif($new_conf_type == 'Standard Array' || $new_conf_type == 'Multi Array')
+{
+ if($new_conf_type == 'Standard Array')
+ {
+ $new_conf_type = 'array';
+ }
+ elseif($new_conf_type == 'Multi Array')
+ {
+ $new_conf_type = 'multi-array';
+ }
+ else
+ {
+ # $new_conf_type is invalid so clear values so we don't create any config
+ $new_conf_value = '';
+ }
+ $new_conf_value = nl2br($_POST['new_conf_multi_value']);
+ $values = explode('
',$new_conf_value);
+ foreach ($values as $item)
+ {
+ $new_conf_value = trim($item);
+ $db_inserted = add_config_item($new_conf_name,$new_conf_value,$new_conf_type,$new_conf_desc);
+ }
+}
+else
+{
+ echo('Bad config type!');
+ $db_inserted = 0;
+ exit;
+}
+
+if($db_inserted == 1)
+{
+ echo('Your new config item has been added');
+}
+else
+{
+ echo('An error occurred adding your config item to the database');
+}
+
+?>
diff --git a/html/forms/config-item-disable.inc.php b/html/forms/config-item-disable.inc.php
new file mode 100644
index 000000000..e44f6afdc
--- /dev/null
+++ b/html/forms/config-item-disable.inc.php
@@ -0,0 +1,48 @@
+
+ *
+ * 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, either version 3 of the License, or (at your
+ * option) any later version. Please see LICENSE.txt at the top level of
+ * the source code distribution for details.
+ */
+
+// FUA
+
+if(!is_numeric($_POST['config_id']))
+{
+ echo('error with data');
+ exit;
+}
+else
+{
+ if($_POST['state'] == 'true')
+ {
+ $state = 1;
+ }
+ elseif($_POST['state'] == 'false')
+ {
+ $state = 0;
+ }
+ else
+ {
+ $state = 0;
+ }
+ $update = dbUpdate(array('config_disabled' => $state), 'config', '`config_id` = ?', array($_POST['config_id']));
+ if(!empty($update) || $update == '0')
+ {
+ echo('success');
+ exit;
+ }
+ else
+ {
+ echo('error');
+ exit;
+ }
+}
+
diff --git a/html/forms/config-item-update.inc.php b/html/forms/config-item-update.inc.php
new file mode 100644
index 000000000..9ba795786
--- /dev/null
+++ b/html/forms/config-item-update.inc.php
@@ -0,0 +1,37 @@
+
+ *
+ * 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, either version 3 of the License, or (at your
+ * option) any later version. Please see LICENSE.txt at the top level of
+ * the source code distribution for details.
+ */
+
+// FUA
+
+if(!is_numeric($_POST['config_id']) || empty($_POST['data']))
+{
+ echo('error with data');
+ exit;
+}
+else
+{
+ $data = mres($_POST['data']);
+ $update = dbUpdate(array('config_value' => "$data"), 'config', '`config_id` = ?', array($_POST['config_id']));
+ if(!empty($update) || $update == '0')
+ {
+ echo('success');
+ exit;
+ }
+ else
+ {
+ echo('error');
+ exit;
+ }
+}
+
diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php
index 7118facdb..9c37be97b 100644
--- a/html/includes/functions.inc.php
+++ b/html/includes/functions.inc.php
@@ -774,7 +774,16 @@ function clean_bootgrid($string) {
$output = str_replace(array("\r","\n"), "", $string);
$output = addslashes($output);
return $output;
+}
+//Insert new config items
+function add_config_item($new_conf_name,$new_conf_value,$new_conf_type,$new_conf_desc) {
+ if (dbInsert(array('config_name' => $new_conf_name, 'config_value' => $new_conf_value, 'config_default' => $new_conf_value, 'config_type' => $new_conf_type, 'config_desc' => $new_conf_desc, 'config_group' => '500_Custom Settings', 'config_sub_group' => '01_Custom settings', 'config_hidden' => '0', 'config_disabled' => '0'), 'config')) {
+ $db_inserted = 1;
+ } else {
+ $db_inserted = 0;
+ }
+ return($db_inserted);
}
?>
diff --git a/html/pages/device/health/mempool.inc.php b/html/pages/device/health/mempool.inc.php
index 2b4e5fcc8..6630c3147 100644
--- a/html/pages/device/health/mempool.inc.php
+++ b/html/pages/device/health/mempool.inc.php
@@ -13,7 +13,7 @@ foreach (dbFetchRows("SELECT * FROM `mempools` WHERE device_id = ?", array($devi
{
if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
- if ($config['memcached']['enable'])
+ if ($config['memcached']['enable'] === TRUE)
{
$state = $memcache->get('mempool-'.$mempool['mempool_id'].'-state');
if($debug) { print_r($state); }
diff --git a/html/pages/device/overview/generic/sensor.inc.php b/html/pages/device/overview/generic/sensor.inc.php
index bda3d04bd..6194c37c0 100644
--- a/html/pages/device/overview/generic/sensor.inc.php
+++ b/html/pages/device/overview/generic/sensor.inc.php
@@ -14,7 +14,7 @@ if (count($sensors))
| ".$k." | ".(is_array($v)?a2t($v):"".wordwrap($v,75,"")." |