Rename the new endpoint to "api.php?versions" and include also current and latest versions + current branches

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2018-06-07 20:21:12 +02:00
parent f35f663be9
commit 7f8d8fe7e2

14
api.php
View File

@@ -73,7 +73,7 @@ elseif (isset($_GET['disable']) && $auth)
}
$data = array_merge($data, array("status" => "disabled"));
}
elseif (isset($_GET['updatecheck']))
elseif (isset($_GET['versions']))
{
// Determine if updates are available for Pi-hole
// using the same script that we use for the footer
@@ -83,7 +83,19 @@ elseif (isset($_GET['updatecheck']))
$updates = array("core_update" => $core_update,
"web_update" => $web_update,
"FTL_update" => $FTL_update);
$current = array("core_current" => $core_current,
"web_current" => $web_current,
"FTL_current" => $FTL_current);
$latest = array("core_latest" => $core_latest,
"web_latest" => $web_latest,
"FTL_latest" => $FTL_latest);
$branches = array("core_branch" => $core_branch,
"web_branch" => $web_branch,
"FTL_branch" => $FTL_branch);
$data = array_merge($data, $updates);
$data = array_merge($data, $current);
$data = array_merge($data, $latest);
$data = array_merge($data, $branches);
}
// Other API functions