mirror of
https://github.com/pi-hole/web.git
synced 2026-04-23 10:19:47 +01:00
API call to modify local CNAME records
Signed-off-by: Alexandr Salamatov <wpgnetworks@gmail.com>
This commit is contained in:
27
api.php
27
api.php
@@ -168,6 +168,33 @@ elseif(isset($_GET['customdns']) && $auth)
|
||||
|
||||
require("scripts/pi-hole/php/customdns.php");
|
||||
}
|
||||
elseif(isset($_GET['customcname']) && $auth)
|
||||
{
|
||||
if(isset($_GET["auth"]))
|
||||
{
|
||||
if($_GET["auth"] !== $pwhash)
|
||||
die("Not authorized!");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Skip token validation if explicit auth string is given
|
||||
check_csrf($_GET['token']);
|
||||
}
|
||||
|
||||
switch ($_GET["action"]) {
|
||||
case 'get':
|
||||
$_POST['action'] = 'get';
|
||||
break;
|
||||
case 'add':
|
||||
$_POST['action'] = 'add';
|
||||
break;
|
||||
case 'delete':
|
||||
$_POST['action'] = 'delete';
|
||||
break;
|
||||
}
|
||||
|
||||
require("scripts/pi-hole/php/customcname.php");
|
||||
}
|
||||
|
||||
// Other API functions
|
||||
require("api_FTL.php");
|
||||
|
||||
Reference in New Issue
Block a user