@@ -179,32 +179,35 @@ private function getMyServersCfgValues()
179179 */
180180 $ flashCfgPath = '/boot/config/plugins/dynamix.my.servers/myservers.cfg ' ;
181181 $ this ->myServersFlashCfg = file_exists ($ flashCfgPath ) ? @parse_ini_file ($ flashCfgPath , true ) : [];
182+ $ connectJsonPath = '/boot/config/plugins/dynamix.my.servers/configs/connect.json ' ;
183+ $ connectConfig = file_exists ($ connectJsonPath ) ? @json_decode (file_get_contents ($ connectJsonPath ), true ) : [];
184+
182185 // ensure some vars are defined here so we don't have to test them later
183- if (empty ($ this -> myServersFlashCfg [ ' remote ' ] ['apikey ' ])) {
184- $ this -> myServersFlashCfg [ ' remote ' ] ['apikey ' ] = "" ;
186+ if (empty ($ connectConfig ['apikey ' ])) {
187+ $ connectConfig ['apikey ' ] = "" ;
185188 }
186- if (empty ($ this -> myServersFlashCfg [ ' remote ' ] ['wanaccess ' ])) {
187- $ this -> myServersFlashCfg [ ' remote ' ][ ' wanaccess ' ] = " no " ;
189+ if (empty ($ connectConfig ['wanaccess ' ])) {
190+ $ connectConfig [ ' wanaccess ' ] = false ;
188191 }
189- if (empty ($ this -> myServersFlashCfg [ ' remote ' ] ['wanport ' ])) {
190- $ this -> myServersFlashCfg [ ' remote ' ] ['wanport ' ] = 33443 ;
192+ if (empty ($ connectConfig ['wanport ' ])) {
193+ $ connectConfig ['wanport ' ] = 33443 ;
191194 }
192- if (empty ($ this -> myServersFlashCfg [ ' remote ' ] ['upnpEnabled ' ])) {
193- $ this -> myServersFlashCfg [ ' remote ' ][ ' upnpEnabled ' ] = " no " ;
195+ if (empty ($ connectConfig ['upnpEnabled ' ])) {
196+ $ connectConfig [ ' upnpEnabled ' ] = false ;
194197 }
195- if (empty ($ this -> myServersFlashCfg [ ' remote ' ] ['dynamicRemoteAccessType ' ])) {
196- $ this -> myServersFlashCfg [ ' remote ' ] ['dynamicRemoteAccessType ' ] = "DISABLED " ;
198+ if (empty ($ connectConfig ['dynamicRemoteAccessType ' ])) {
199+ $ connectConfig ['dynamicRemoteAccessType ' ] = "DISABLED " ;
197200 }
198201
199202 $ this ->apiKey = $ this ->myServersFlashCfg ['upc ' ]['apikey ' ] ?? '' ;
200203 $ this ->apiVersion = $ this ->myServersFlashCfg ['api ' ]['version ' ] ?? '' ;
201- $ this ->avatar = (!empty ($ this -> myServersFlashCfg [ ' remote ' ][ ' avatar ' ]) && $ this ->connectPluginInstalled ) ? $ this -> myServersFlashCfg [ ' remote ' ] ['avatar ' ] : '' ;
202- $ this ->email = $ this -> myServersFlashCfg [ ' remote ' ] ['email ' ] ?? '' ;
203- $ this ->hasRemoteApikey = !empty ($ this -> myServersFlashCfg [ ' remote ' ] ['apikey ' ]);
204- $ this ->registered = !empty ($ this -> myServersFlashCfg [ ' remote ' ] ['apikey ' ]) && $ this ->connectPluginInstalled ;
205- $ this ->registeredTime = $ this -> myServersFlashCfg [ ' remote ' ] ['regWizTime ' ] ?? '' ;
206- $ this ->username = $ this -> myServersFlashCfg [ ' remote ' ] ['username ' ] ?? '' ;
207- $ this ->ssoEnabled = !empty ($ this -> myServersFlashCfg [ ' remote ' ] ['ssoSubIds ' ] ?? '' );
204+ $ this ->avatar = (!empty ($ connectConfig [ ' avatar ' ]) && $ this ->connectPluginInstalled ) ? $ connectConfig ['avatar ' ] : '' ;
205+ $ this ->email = $ connectConfig ['email ' ] ?? '' ;
206+ $ this ->hasRemoteApikey = !empty ($ connectConfig ['apikey ' ]);
207+ $ this ->registered = !empty ($ connectConfig ['apikey ' ]) && $ this ->connectPluginInstalled ;
208+ $ this ->registeredTime = $ connectConfig ['regWizTime ' ] ?? '' ;
209+ $ this ->username = $ connectConfig ['username ' ] ?? '' ;
210+ $ this ->ssoEnabled = !empty ($ connectConfig ['ssoSubIds ' ] ?? '' );
208211 }
209212
210213 private function getConnectKnownOrigins ()
0 commit comments