1
0
www.mikescher.com/www/commands/progs_updatecheck.php

22 lines
699 B
PHP
Raw Normal View History

<?php
2020-01-16 13:21:14 +01:00
require_once (__DIR__ . '/../internals/website.php');
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;
2020-01-16 13:21:14 +01:00
if (!isset($API_OPTIONS['name'])) { $FRAME_OPTIONS->forceResult(400, "Wrong parameters."); return; }
2023-08-27 01:13:47 +02:00
$name = urldecode($API_OPTIONS['name']);
2020-01-16 13:21:14 +01:00
$updatedata = $SITE->modules->UpdatesLog()->listUpdateData();
2020-01-16 13:21:14 +01:00
if (!array_key_exists($name, $updatedata)) { $FRAME_OPTIONS->forceResult(404, 'Invalid Request - [Name] not found'); return; }
$data = $updatedata[$name];
2020-01-16 13:21:14 +01:00
$SITE->modules->UpdatesLog()->insert($name, $data['version']);
print($name."<hr>".$data['version']."<hr>".$data['url']);