diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index f71d0324..6e6f5ef3 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -58,6 +58,8 @@ class Admin implements ISettings { $checkVersion = $this->config->getAppValue('passman', 'check_version', '1') === '1'; $localVersion = $this->appManager->getAppInfo('passman')["version"]; $githubVersion = $this->l->t('Unable to get version info'); + $githubReleaseUrl = null; + if ($checkVersion) { // get latest GitHub release version @@ -71,6 +73,10 @@ class Admin implements ISettings { $data = json_decode($json); if (isset($data->tag_name) && is_string($data->tag_name)) { $githubVersion = $data->tag_name; + + if (isset($data->html_url) && is_string($data->html_url)) { + $githubReleaseUrl = $data->html_url; + } } } } catch (\Exception $e) { @@ -82,6 +88,7 @@ class Admin implements ISettings { return new TemplateResponse('passman', 'admin', [ 'localVersion' => $localVersion, 'githubVersion' => $githubVersion, + 'githubReleaseUrl' => $githubReleaseUrl, 'checkVersion' => $checkVersion, ], 'blank'); } diff --git a/templates/admin.php b/templates/admin.php index 71b38e9d..bee8264c 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -12,7 +12,14 @@ style('passman', 'vendor/font-awesome/font-awesome.min');

t('Passman Settings')); ?>

t('GitHub version:') . ' ' . $_['githubVersion']); + if ($_['githubReleaseUrl']) { + p($l->t('GitHub version:')); + ?> + + t('GitHub version:') . ' ' . $_['githubVersion']); + } print '
'; } ?> Local version: