mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-10-28 03:51:08 -04:00
FE: Hardening
This commit is contained in:
1 parent
90f2714639
commit
7795037843
3 files changed
+4
-2
No files matched your search
@@ -508,7 +508,7 @@ function UploadConfig()
|
||||
appConfBase64 = btoa(appConf)
|
||||
|
||||
// import
|
||||
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "app.conf" }, function(msg) {
|
||||
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "app.conf", csrf_token: <?= json_encode(getCsrfToken()) ?> }, function(msg) {
|
||||
console.log(msg);
|
||||
// showMessage(msg);
|
||||
write_notification(`[Maintenance]: ${msg}`, 'interrupt');
|
||||
|
||||
@@ -17,6 +17,8 @@ global $configFolderPath;
|
||||
// Handle incoming requests
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
||||
requireCsrfToken();
|
||||
|
||||
$base64Data = $_POST['base64data'] ?? null;
|
||||
if (!$base64Data) {
|
||||
http_response_code(400);
|
||||
|
||||
@@ -1231,7 +1231,7 @@ function saveWorkflows()
|
||||
appConfBase64 = btoa(JSON.stringify(getWorkflowsJson()))
|
||||
|
||||
// import
|
||||
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "workflows.json" })
|
||||
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "workflows.json", csrf_token: <?= json_encode(getCsrfToken()) ?> })
|
||||
.done(function(msg) {
|
||||
console.log(msg);
|
||||
write_notification(`[WF]: ${msg}`, 'interrupt');
|
||||
|
||||
Reference in new issue
Block a user