mirror of
https://github.com/pi-hole/web.git
synced 2026-04-23 18:29:43 +01:00
Remove duplicate function declarations
and move functions to `func.php`. Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
require_once('auth.php');
|
||||
require_once('func.php');
|
||||
require_once('database.php');
|
||||
|
||||
// Authentication checks
|
||||
if (!isset($api)) {
|
||||
@@ -21,27 +23,9 @@ if (!isset($api)) {
|
||||
|
||||
$reload = false;
|
||||
|
||||
require_once('func.php');
|
||||
require_once('database.php');
|
||||
$QueriesDB = getQueriesDBFilename();
|
||||
$db = SQLite3_connect($QueriesDB, SQLITE3_OPEN_READWRITE);
|
||||
|
||||
function JSON_success($message = null)
|
||||
{
|
||||
header('Content-type: application/json');
|
||||
echo json_encode(array('success' => true, 'message' => $message));
|
||||
}
|
||||
|
||||
function JSON_error($message = null)
|
||||
{
|
||||
header('Content-type: application/json');
|
||||
$response = array('success' => false, 'message' => $message);
|
||||
if (isset($_POST['action'])) {
|
||||
array_push($response, array('action' => $_POST['action']));
|
||||
}
|
||||
echo json_encode($response);
|
||||
}
|
||||
|
||||
if ($_POST['action'] == 'delete_network_entry' && isset($_POST['id'])) {
|
||||
// Delete netwwork and network_addresses table entry identified by ID
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user