2019-12-28 22:42:25 +01:00
|
|
|
<?php
|
2020-01-16 13:21:14 +01:00
|
|
|
require_once (__DIR__ . '/../internals/website.php');
|
2019-12-28 22:42:25 +01:00
|
|
|
|
2020-01-16 13:21:14 +01:00
|
|
|
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
|
|
|
|
/** @var URLRoute $ROUTE */ global $ROUTE;
|
|
|
|
/** @var Website $SITE */ global $SITE;
|
2019-12-28 22:42:25 +01:00
|
|
|
|
|
|
|
|
2020-01-16 13:21:14 +01:00
|
|
|
if (!isset($API_OPTIONS['name'])) { $FRAME_OPTIONS->forceResult(400, "Wrong parameters."); return; }
|
2019-12-28 22:42:25 +01:00
|
|
|
|
2023-08-27 01:13:47 +02:00
|
|
|
$name = urldecode($API_OPTIONS['name']);
|
2019-12-28 22:42:25 +01:00
|
|
|
|
2020-01-16 13:21:14 +01:00
|
|
|
$updatedata = $SITE->modules->UpdatesLog()->listUpdateData();
|
2019-12-28 22:42:25 +01:00
|
|
|
|
2020-01-16 13:21:14 +01:00
|
|
|
if (!array_key_exists($name, $updatedata)) { $FRAME_OPTIONS->forceResult(404, 'Invalid Request - [Name] not found'); return; }
|
2019-12-28 22:42:25 +01:00
|
|
|
|
|
|
|
$data = $updatedata[$name];
|
|
|
|
|
2020-01-16 13:21:14 +01:00
|
|
|
$SITE->modules->UpdatesLog()->insert($name, $data['version']);
|
2019-12-28 22:42:25 +01:00
|
|
|
|
|
|
|
print($name."<hr>".$data['version']."<hr>".$data['url']);
|