Refactor [su_ajax|admin_cmd|api_webhook] methods into single /api/ interface
This commit is contained in:
21
www/commands/progs_updatecheck.php
Normal file
21
www/commands/progs_updatecheck.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
global $API_OPTIONS;
|
||||
|
||||
require_once (__DIR__ . '/../internals/base.php');
|
||||
require_once (__DIR__ . '/../internals/programs.php');
|
||||
require_once (__DIR__ . '/../internals/updateslog.php');
|
||||
|
||||
if (!isset($API_OPTIONS['name'])) die("Wrong parameters.");
|
||||
|
||||
$name = $API_OPTIONS['name'];
|
||||
|
||||
$updatedata = Programs::listUpdateData();
|
||||
|
||||
if (!array_key_exists($name, $updatedata)) httpError(404, 'Invalid Request - [Name] not found');
|
||||
|
||||
$data = $updatedata[$name];
|
||||
|
||||
UpdatesLog::insert($name, $data['version']);
|
||||
|
||||
print($name."<hr>".$data['version']."<hr>".$data['url']);
|
||||
Reference in New Issue
Block a user