'; if (file_exists(CONFIG_HTTP_DIR . '/default/config.tgz')) $current = realpath(CONFIG_HTTP_DIR . '/default/config.tgz'); $files = array(); foreach (glob(CONFIG_TGZ_LIST_DIR . '/*.tgz') as $file) { $files[] = array( 'file' => basename($file), 'current' => ($current === realpath($file)) ); } Render::addTemplate('page-tgz-list', array('files' => $files, 'token' => Session::get('token'))); } function list_remote_configs() { if (!User::hasPermission('superadmin')) { Message::addError('no-permission'); return; } $data = Util::download(CONFIG_REMOTE_TGZ . '/list.php', 4, $code); if ($code !== 200) { Message::addError('remote-timeout', CONFIG_REMOTE_TGZ . '/list.php', $code); return; } $list = json_decode($data, true); if (!is_array($list)) { Message::addError('remote-parse-failed', $data); return; } $id = 0; foreach ($list as &$item) { $item['id'] = 'download' . (++$id); } Render::addTemplate('page-remote-tgz-list', array('files' => $list)); }