fix internet_enabled
This commit is contained in:
@@ -37,7 +37,7 @@ class UrbackupApiClient
|
|||||||
|
|
||||||
private string $server_version = '';
|
private string $server_version = '';
|
||||||
|
|
||||||
private bool $is_version_2_5_or_higher = false;
|
private bool $is_version_2_4_or_higher = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
@@ -52,15 +52,10 @@ class UrbackupApiClient
|
|||||||
$this->password = (string) ($server->fields['api_password'] ?? '');
|
$this->password = (string) ($server->fields['api_password'] ?? '');
|
||||||
$this->ignore_ssl = ((int) ($server->fields['ignore_ssl'] ?? 0)) === 1;
|
$this->ignore_ssl = ((int) ($server->fields['ignore_ssl'] ?? 0)) === 1;
|
||||||
$this->server_version = (string) ($server->fields['server_version'] ?? '');
|
$this->server_version = (string) ($server->fields['server_version'] ?? '');
|
||||||
$this->is_version_2_5_or_higher = $this->detectVersion2_5OrHigher();
|
$this->is_version_2_4_or_higher = $this->detectVersion2_4OrHigher();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private function detectVersion2_4OrHigher(): bool
|
||||||
* Detect if server version is 2.5 or higher.
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
private function detectVersion2_5OrHigher(): bool
|
|
||||||
{
|
{
|
||||||
if ($this->server_version === '') {
|
if ($this->server_version === '') {
|
||||||
return false;
|
return false;
|
||||||
@@ -77,7 +72,7 @@ class UrbackupApiClient
|
|||||||
if ($major > 2) {
|
if ($major > 2) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ($major === 2 && $minor >= 5) {
|
if ($major === 2 && $minor >= 4) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +86,7 @@ class UrbackupApiClient
|
|||||||
*/
|
*/
|
||||||
public function getInternetModeSettingKey(): string
|
public function getInternetModeSettingKey(): string
|
||||||
{
|
{
|
||||||
return $this->is_version_2_5_or_higher ? 'internet_mode_enabled' : 'internet_mode';
|
return $this->is_version_2_4_or_higher ? 'internet_mode_enabled' : 'internet_mode';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user