mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 10:50:23 +01:00
Moved CNAME functions to func.php Added teleporter support Fixed CNAME and DNS file declaration (filename was declarated in seperate file, therefore trying to read those files from func.php failed) Fixed error and success response functions in func.php (calling addCustomDNSEntry and addCustomCNAMEEntry repeatedly from teleporter failed because of error function defined inside of those functions) Signed-off-by: Matthias Rank <development@m-rank.de>
24 lines
646 B
PHP
24 lines
646 B
PHP
<?php
|
|
|
|
require_once "func.php";
|
|
|
|
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)!');
|
|
}
|
|
|
|
switch ($_REQUEST['action'])
|
|
{
|
|
case 'get': echo json_encode(echoCustomCNAMEEntries()); break;
|
|
case 'add': echo json_encode(addCustomCNAMEEntry()); break;
|
|
case 'delete': echo json_encode(deleteCustomCNAMEEntry()); break;
|
|
default:
|
|
die("Wrong action");
|
|
}
|
|
?>
|