mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 02:39:25 +01:00
Also use variable to disable reload in delteALL functions
Signed-off-by: yubiuser <ckoenig@posteo.de>
This commit is contained in:
@@ -278,14 +278,17 @@ function deleteCustomDNSEntry()
|
||||
}
|
||||
}
|
||||
|
||||
function deleteAllCustomDNSEntries()
|
||||
function deleteAllCustomDNSEntries($reload="")
|
||||
{
|
||||
try
|
||||
{
|
||||
if(isset($_REQUEST['reload']))
|
||||
$reload = $_REQUEST['reload'];
|
||||
|
||||
$existingEntries = getCustomDNSEntries();
|
||||
// passing false to pihole_execute stops pihole from reloading after each enty has been deleted
|
||||
foreach ($existingEntries as $entry) {
|
||||
pihole_execute("-a removecustomdns ".$entry->ip." ".$entry->domain." false");
|
||||
pihole_execute("-a removecustomdns ".$entry->ip." ".$entry->domain." ".$reload);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -427,14 +430,17 @@ function deleteCustomCNAMEEntry()
|
||||
}
|
||||
}
|
||||
|
||||
function deleteAllCustomCNAMEEntries()
|
||||
function deleteAllCustomCNAMEEntries($reload="")
|
||||
{
|
||||
try
|
||||
{
|
||||
if(isset($_REQUEST['reload']))
|
||||
$reload = $_REQUEST['reload'];
|
||||
|
||||
$existingEntries = getCustomCNAMEEntries();
|
||||
// passing false to pihole_execute stops pihole from reloading after each enty has been deleted
|
||||
foreach ($existingEntries as $entry) {
|
||||
pihole_execute("-a removecustomcname ".$entry->domain." ".$entry->target." false");
|
||||
pihole_execute("-a removecustomcname ".$entry->domain." ".$entry->target." ".$reload);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user