liam-linux-account-manager/views/serveraccount_sync_status.php

18 lines
559 B
PHP
Raw Permalink Normal View History

2021-11-16 15:11:32 +01:00
<?php
try {
$server = $server_dir->get_server_by_hostname($router->vars['hostname']);
$account = $server->get_account_by_name($router->vars['account']);
} catch(ServerAccountNotFoundException $e) {
require('views/error404.php');
die;
} catch(ServerNotFoundException $e) {
require('views/error404.php');
die;
}
$page = new PageSection('serveraccount_sync_status_json');
$page->set('sync_status', $account->sync_status);
$page->set('pending', $account->sync_is_pending());
header('Content-type: application/json; charset=utf-8');
echo $page->generate();