mirror of
https://github.com/pi-hole/web.git
synced 2026-05-02 14:42:23 +01:00
Calling FTL API directly from PHP
- Using constants for default values - Remove unnecessary variable - Replace `piholeStatusAPI()` with a call to FTL API - Transfer `api.php?status` code from `api.php` to `api_FTL.php` - Change `piholeStatus()` to use FTL info (no need to use `pihole`). Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
6
api.php
6
api.php
@@ -13,14 +13,10 @@ require_once("scripts/pi-hole/php/database.php");
|
||||
require_once("scripts/pi-hole/php/auth.php");
|
||||
check_cors();
|
||||
|
||||
$FTL_IP = "127.0.0.1";
|
||||
|
||||
$data = array();
|
||||
|
||||
// Common API functions
|
||||
if (isset($_GET['status'])) {
|
||||
$data = array_merge($data, array("status" => piholeStatusAPI()));
|
||||
} elseif (isset($_GET['enable']) && $auth) {
|
||||
if (isset($_GET['enable']) && $auth) {
|
||||
if(isset($_GET["auth"]))
|
||||
{
|
||||
if($_GET["auth"] !== $pwhash)
|
||||
|
||||
Reference in New Issue
Block a user