mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Add new "network" API endpoint to database API
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
+13
@@ -94,6 +94,19 @@ if(!$db)
|
||||
die("Error connecting to database");
|
||||
}
|
||||
|
||||
if(isset($_GET["network"]) && $auth)
|
||||
{
|
||||
$network = array();
|
||||
$results = $db->query('SELECT * FROM network');
|
||||
|
||||
if(!is_bool($results))
|
||||
$result = $results;
|
||||
while($res = $results->fetchArray(SQLITE3_ASSOC))
|
||||
array_push($network, $res);
|
||||
|
||||
$data = array_merge($data, array('network' => $network));
|
||||
}
|
||||
|
||||
if (isset($_GET['getAllQueries']) && $auth)
|
||||
{
|
||||
$allQueries = array();
|
||||
|
||||
Reference in New Issue
Block a user