API call to modify local DNS records

Signed-off-by: Alexandr Salamatov <wpgnetworks@gmail.com>
This commit is contained in:
Alexandr Salamatov
2022-01-19 16:07:18 -06:00
parent fe32e57390
commit dc598295ca
2 changed files with 34 additions and 5 deletions

View File

@@ -5,11 +5,13 @@
require_once('auth.php');
// Authentication checks
if (isset($_POST['token'])) {
check_cors();
check_csrf($_POST['token']);
} else {
log_and_die('Not allowed (login session invalid or expired, please relogin on the Pi-hole dashboard)!');
if (!isset($api)) {
if (isset($_POST['token'])) {
check_cors();
check_csrf($_POST['token']);
} else {
log_and_die('Not allowed (login session invalid or expired, please relogin on the Pi-hole dashboard)!');
}
}