mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Be able to enable/disable user lists and add multiple user lists at a time (one URL per line)
This commit is contained in:
+17
-3
@@ -331,13 +331,27 @@ function readAdlists(&$list, $listname)
|
||||
if(isset($_POST["adlist-".$key]) && !$value[0])
|
||||
{
|
||||
// Is not enabled, but should be
|
||||
exec("sudo pihole -a adlist enable ".escapeshellcmd ($value[1]));
|
||||
exec("sudo pihole -a adlist enable default ".escapeshellcmd ($value[1]));
|
||||
|
||||
}
|
||||
elseif(!isset($_POST["adlist-".$key]) && $value[0])
|
||||
{
|
||||
// Is enabled, but shouldn't be
|
||||
exec("sudo pihole -a adlist disable ".escapeshellcmd ($value[1]));
|
||||
exec("sudo pihole -a adlist disable default ".escapeshellcmd ($value[1]));
|
||||
}
|
||||
}
|
||||
foreach ($adlistsuser as $key => $value)
|
||||
{
|
||||
if(isset($_POST["userlist-".$key]) && !$value[0])
|
||||
{
|
||||
// Is not enabled, but should be
|
||||
exec("sudo pihole -a adlist enable user ".escapeshellcmd ($value[1]));
|
||||
|
||||
}
|
||||
elseif(!isset($_POST["userlist-".$key]) && $value[0])
|
||||
{
|
||||
// Is enabled, but shouldn't be
|
||||
exec("sudo pihole -a adlist disable user ".escapeshellcmd ($value[1]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,7 +360,7 @@ function readAdlists(&$list, $listname)
|
||||
$domains = array_filter(preg_split('/\r\n|[\r\n]/', $_POST["newuserlists"]));
|
||||
foreach($domains as $domain)
|
||||
{
|
||||
exec("sudo pihole -a adlist adduser ".escapeshellcmd($domain));
|
||||
exec("sudo pihole -a adlist add user ".escapeshellcmd($domain));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -491,7 +491,7 @@
|
||||
<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>
|
||||
<?php } ?>
|
||||
<label>User defined lists</label>
|
||||
<label>User defined list (preserved on updates)</label>
|
||||
<?php foreach ($adlistsuser as $key => $value) { ?>
|
||||
<div class="form-group">
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user