Error on unknown dev, format

This commit is contained in:
Jonathan Flueren 2023-08-16 16:53:38 +02:00
parent e5b95ad84a
commit ab31b191a9
3 changed files with 13 additions and 6 deletions

View file

@ -15,7 +15,7 @@ Dependencies:
Configs to change:
- `scanner/scan.sh`:
- WiFi adapter name
- network restart routines
- network restart routines (front-end)
- `scanner/upload.py`:
- URLs for webhook and identities
- webhook secret

View file

@ -71,6 +71,8 @@ function remove_identity($mac)
$hashed_mac = hash_mac($mac);
$url = strtok($_SERVER['REQUEST_URI'], '?');
$identities = json_decode(file_get_contents(IDENTITIES_FILE), true);
$new_identities = array();
@ -84,9 +86,14 @@ function remove_identity($mac)
$_SESSION['form_success'] = true;
$_SESSION['form_success_message'] = 'Identity successfully removed.';
header("Location: " . strtok($_SERVER['REQUEST_URI'], '?'), true, 303);
header("Location: " . $url, true, 303);
exit();
}
$_SESSION['form_success'] = false;
$_SESSION['form_success_message'] = 'Identity not found.';
header("Location: " . $url, true, 303);
exit();
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {