mirror of
https://github.com/pi-hole/web.git
synced 2026-04-25 11:19:59 +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:
@@ -7,6 +7,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)) {
|
||||
@@ -20,37 +22,9 @@ if (!isset($api)) {
|
||||
|
||||
$reload = false;
|
||||
|
||||
require_once('func.php');
|
||||
require_once('database.php');
|
||||
$GRAVITYDB = getGravityDBFilename();
|
||||
$db = SQLite3_connect($GRAVITYDB, SQLITE3_OPEN_READWRITE);
|
||||
|
||||
function JSON_success($message = null)
|
||||
{
|
||||
header('Content-type: application/json');
|
||||
echo json_encode(array('success' => true, 'message' => $message));
|
||||
}
|
||||
|
||||
function JSON_warning($message = null)
|
||||
{
|
||||
header('Content-type: application/json');
|
||||
echo json_encode(array(
|
||||
'success' => true,
|
||||
'warning' => 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);
|
||||
}
|
||||
|
||||
function verify_ID_array($arr)
|
||||
{
|
||||
if (!is_array($arr)) {
|
||||
|
||||
Reference in New Issue
Block a user