Skip to content

Commit 1d30da5

Browse files
committed
fix: read ssoSubIds in state.php from api.json
1 parent 3cfe9fe commit 1d30da5

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/api-config.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,18 @@ public static function getApiVersion()
9595
return !empty($version) ? $version : 'unknown';
9696
}
9797
}
98+
99+
100+
class ApiUserConfig {
101+
public const CONFIG_PATH = '/boot/config/plugins/dynamix.my.servers/configs/api.json';
102+
103+
public static function getConfig() {
104+
$config = json_decode(file_get_contents(self::CONFIG_PATH), true);
105+
return $config;
106+
}
107+
108+
public static function isSSOEnabled() {
109+
$config = self::getConfig();
110+
return !empty($config['ssoSubIds'] ?? '');
111+
}
112+
}

plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include/state.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ private function getMyServersCfgValues()
202202
$this->registered = !empty($connectConfig['apikey']) && $this->connectPluginInstalled;
203203
$this->registeredTime = $connectConfig['regWizTime'] ?? '';
204204
$this->username = $connectConfig['username'] ?? '';
205-
$this->ssoEnabled = !empty($connectConfig['ssoSubIds'] ?? '');
205+
$this->ssoEnabled = ApiUserConfig::isSSOEnabled();
206206
}
207207

208208
private function getConnectKnownOrigins()

0 commit comments

Comments
 (0)