Add back in list functionality

This commit is contained in:
Mcat12
2016-02-24 18:42:06 -05:00
parent 3ca9c7b4da
commit 020f9a433b
4 changed files with 154 additions and 0 deletions

15
php/get.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
if(!isset($_GET['list']))
die();
$type = $_GET['list'];
$rawList = file_get_contents("/etc/pihole/${type}list.txt");
$list = explode("\n", $rawList);
// Get rid of empty lines
for($i = sizeof($list)-1; $i >= 0; $i--) {
if($list[$i] == "")
unset($list[$i]);
}
echo json_encode(array_values($list));