mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Only enable/disable those lists where the status should be changed (efficiency + speed)
This commit is contained in:
@@ -328,15 +328,17 @@ function readAdlists(&$list, $listname)
|
||||
case "adlists":
|
||||
foreach ($adlistsdefault as $key => $value)
|
||||
{
|
||||
if(isset($_POST["adlist-".$key]))
|
||||
if(isset($_POST["adlist-".$key]) && !$value[0])
|
||||
{
|
||||
$action = "enable";
|
||||
// Is not enabled, but should be
|
||||
exec("sudo pihole -a adlist enable ".escapeshellcmd ($value[1]));
|
||||
|
||||
}
|
||||
else
|
||||
elseif(!isset($_POST["adlist-".$key]) && $value[0])
|
||||
{
|
||||
$action = "disable";
|
||||
// Is enabled, but shouldn't be
|
||||
exec("sudo pihole -a adlist disable ".escapeshellcmd ($value[1]));
|
||||
}
|
||||
exec("sudo pihole -a adlist ".$action." ".escapeshellcmd ($value[1]));
|
||||
}
|
||||
|
||||
if(strlen($_POST["newuserlists"]) > 1)
|
||||
|
||||
+1
-1
@@ -494,7 +494,7 @@
|
||||
<label>User defined lists</label>
|
||||
<?php foreach ($adlistsuser as $key => $value) { ?>
|
||||
<div class="form-group">
|
||||
<div class="checkbox"><label style="word-break: break-word;"><input type="checkbox" name="adlist-<?php echo $key; ?>" <?php if($value[0]){ ?>checked<?php } ?>> <a href="<?php echo htmlentities ($value[1]); ?>" target="_new"><?php echo htmlentities($value[1]); ?></a></label></div>
|
||||
<div class="checkbox"><label style="word-break: break-word;"><input type="checkbox" name="userlist-<?php echo $key; ?>" <?php if($value[0]){ ?>checked<?php } ?>> <a href="<?php echo htmlentities ($value[1]); ?>" target="_new"><?php echo htmlentities($value[1]); ?></a></label></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="form-group">
|
||||
|
||||
Reference in New Issue
Block a user