mirror of
https://github.com/nextcloud/passman.git
synced 2025-11-09 21:51:36 +08:00
check has_internet_connection configuration before fetching the version from github
This commit is contained in:
parent
d6bad76c93
commit
93e96a0107
1 changed files with 3 additions and 1 deletions
|
|
@ -55,12 +55,13 @@ class Admin implements ISettings {
|
||||||
* @return TemplateResponse
|
* @return TemplateResponse
|
||||||
*/
|
*/
|
||||||
public function getForm(): TemplateResponse {
|
public function getForm(): TemplateResponse {
|
||||||
|
$hasInternetConnection = $this->config->getSystemValue('has_internet_connection', true);
|
||||||
$checkVersion = $this->config->getAppValue('passman', 'check_version', '1') === '1';
|
$checkVersion = $this->config->getAppValue('passman', 'check_version', '1') === '1';
|
||||||
$localVersion = $this->appManager->getAppInfo('passman')["version"];
|
$localVersion = $this->appManager->getAppInfo('passman')["version"];
|
||||||
$githubVersion = $this->l->t('Unable to get version info');
|
$githubVersion = $this->l->t('Unable to get version info');
|
||||||
$githubReleaseUrl = null;
|
$githubReleaseUrl = null;
|
||||||
|
|
||||||
if ($checkVersion) {
|
if ($checkVersion && $hasInternetConnection) {
|
||||||
// get latest GitHub release version
|
// get latest GitHub release version
|
||||||
|
|
||||||
$url = 'https://api.github.com/repos/nextcloud/passman/releases/latest';
|
$url = 'https://api.github.com/repos/nextcloud/passman/releases/latest';
|
||||||
|
|
@ -90,6 +91,7 @@ class Admin implements ISettings {
|
||||||
'githubVersion' => $githubVersion,
|
'githubVersion' => $githubVersion,
|
||||||
'githubReleaseUrl' => $githubReleaseUrl,
|
'githubReleaseUrl' => $githubReleaseUrl,
|
||||||
'checkVersion' => $checkVersion,
|
'checkVersion' => $checkVersion,
|
||||||
|
'hasInternetConnection' => $hasInternetConnection,
|
||||||
], 'blank');
|
], 'blank');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue