From 3c99242508cc573674c8f31e53c2408596e58380 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Fri, 20 Jul 2018 14:10:31 +0200 Subject: [PATCH] Improved metaconsole sync (added centralized management) --- pandora_console/include/functions_config.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 7e4fd076c4..fcfdf925c8 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2291,4 +2291,19 @@ function config_prepare_session() { ini_set("post_max_size", $config["max_file_size"]); ini_set("upload_max_filesize", $config["max_file_size"]); } + +function config_update_value_in_db ($token, $value) { + $inserted_value = db_get_value('value', 'tconfig', '`token`', $token); + if ($inserted_value === false) { + return db_process_sql_insert( + 'tconfig', + array('value' => $value, 'token' => $token) + ) !== false; + } + else { + return db_process_sql_update( + 'tconfig', array('value' => $value), array('token' => $token) + ) !== false; + } +} ?>