File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.my.servers/include Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff 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 ()
You can’t perform that action at this time.
0 commit comments