PUSHPROD settings v 0.1

This commit is contained in:
Jokob-sk
2022-12-23 23:43:33 +11:00
parent eb96791223
commit b7cbb39b51
2 changed files with 80 additions and 84 deletions

View File

@@ -145,15 +145,16 @@ function saveSettings()
// chmod($fullConfPath, 0755);
if(file_exists( $fullConfPath) == 1)
if(file_exists( $fullConfPath) != 1)
{
echo 'File "'.$fullConfPath.'" not found or missing read permissions. Creating a new <code>pialert.conf</code> file.';
}
// create a backup copy
if (!copy($fullConfPath, $new_location))
elseif (!copy($fullConfPath, $new_location))
{
echo "Failed to copy file ".$fullConfPath." to ".$new_location." <br/> Check your permissions to allow read/write access to the /config folder.";
}
{
echo "Backup of original pialert.conf created: <code>".$new_name."</code><br/>";
// generate a clean pialert.conf file
$groups = [];
@@ -222,10 +223,8 @@ function saveSettings()
fwrite($newConfig, $txt);
fclose($newConfig);
}
} else {
echo 'File "'.$fullConfPath.'" not found or missing read permissions.';
}
echo "<br/>Settings saved to the <code>pialert.conf</code> file. Backup of pialert.conf created: <code>".$new_name."</code>.
<br/><b>Restart the container for the chanegs to take effect.</b>";
}
@@ -312,7 +311,4 @@ function setCache($key, $value) {
}
?>

View File

@@ -308,7 +308,7 @@ $db->close();
success: function(data, textStatus) {
// $("#result").html(data);
console.log(data);
showModalDefault ('Result', data + "<br/><b>Restart the container for the chanegs to take effect.</b>");
showModalDefault ('Result', data );
}
})
}