do updatecheck

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-02-22 11:37:30 +01:00
parent 60029ba1c3
commit 1974cb5217
6 changed files with 36 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
<?php
namespace Froxlor\Ajax;
use Exception;
@@ -161,14 +162,20 @@ class Ajax
private function getUpdateCheck(array $session)
{
UI::initTwig();
UI::twig()->addGlobal('s', $this->session);
// TODO: set variables from current session
try {
return \Froxlor\Api\Commands\Froxlor::getLocal([
$json_result = \Froxlor\Api\Commands\Froxlor::getLocal([
'adminid' => 1,
'adminsession' => 1,
'change_serversettings' => 1,
'loginname' => 'updatecheck'
])->checkUpdate();
$result = json_decode($json_result, true)['data'];
echo UI::twig()->render($this->theme . '/misc/version_top.html.twig', $result);
exit;
} catch (Exception $e) {
\Froxlor\UI\Response::dynamic_error($e->getMessage());
}