diff --git a/app/vars/vars.php b/app/vars/vars.php index b6eef31c0f..2ed9401ff4 100644 --- a/app/vars/vars.php +++ b/app/vars/vars.php @@ -38,6 +38,25 @@ else { $language = new text; $text = $language->get(); +//toggle enabled state + if ($_REQUEST['id'] != '' && $_REQUEST['enabled'] != '') { + $sql = "update v_vars set "; + $sql .= "var_enabled = '".check_str($_REQUEST['enabled'])."' "; + $sql .= "where var_uuid = '".check_str($_REQUEST['id'])."' "; + $db->exec(check_sql($sql)); + unset($sql); + + //unset the user defined variables + $_SESSION["user_defined_variables"] = ""; + + //synchronize the configuration + save_var_xml(); + + $_SESSION["message"] = $text['message-update']; + header("Location: vars.php?id=".$_REQUEST['id']); + exit; + } + //include the header require_once "resources/header.php"; $document['title'] = $text['title-variables']; @@ -137,13 +156,8 @@ else { echo " \n"; echo "