PUSHPROD fix settings & LOG_PRINT

This commit is contained in:
Jokob-sk
2022-12-25 10:09:34 +11:00
parent ba8fa0b37b
commit d6a5f23345
5 changed files with 43 additions and 33 deletions

View File

@@ -46,7 +46,7 @@ function getParameter() {
WHERE par_ID="'. quotes($_REQUEST['parameter']) .'"';
$result = $db->query($sql);
$row = $result -> fetchArray (SQLITE3_NUM);
$row = $result -> fetchArray (SQLITE3_NUM);
$value = $row[0];
echo (json_encode ($value));

View File

@@ -70,13 +70,12 @@ require '/home/pi/pialert/front/php/templates/language/'.$pia_lang_selected.'.ph
$FUNCTION = [];
$SETTINGS = [];
if(array_search('function', $FUNCTION) != FALSE)
{
if(array_key_exists('function', $_REQUEST) != FALSE)
{echo 'here'.$timestamp ;
$FUNCTION = $_REQUEST['function'];
}
if(array_search('function', $SETTINGS) != FALSE)
if(array_key_exists('settings', $_REQUEST) != FALSE)
{
$SETTINGS = $_REQUEST['settings'];
}
@@ -211,7 +210,7 @@ function saveSettings()
{
global $SETTINGS, $FUNCTION, $config_file, $fullConfPath, $configFolderPath, $timestamp;
echo 'here'.$timestamp ;
// save in the file
$new_name = $config_file.'_'.$timestamp.'.backup';
@@ -233,6 +232,8 @@ function saveSettings()
// generate a clean pialert.conf file
$groups = [];
$txt = "";
$txt = $txt."#-----------------AUTOGENERATED FILE-----------------#\n";
$txt = $txt."# #\n";
$txt = $txt."# Generated: ".$timestamp." #\n";
@@ -299,7 +300,7 @@ function saveSettings()
displayMessage("<br/>Settings saved to the <code>".$config_file."</code> file.
Backup of ".$config_file." created: <code>".$new_name."</code>.<br/>
<b>Restart the container for the chanegs to take effect.</b>",
<b>Restart the container for the changes to take effect.</b>",
FALSE, TRUE, TRUE, TRUE);
}