#!/usr/bin/php $var['csrf_token'], '#file' => $mys_cfg, '#section' => 'remote' ]; foreach($orig['remote'] as $key => $value) { $fields_mys_remote[$key] = $value; } update($url, http_build_query($fields_mys_remote)); } /* // write [wizard] section to myservers.cfg if(!empty($orig['wizard'])) { $fields_mys_wizard = [ 'csrf_token' => $var['csrf_token'], '#file' => $mys_cfg, '#section' => 'wizard' ]; foreach($orig['wizard'] as $key => $value) { $fields_mys_wizard[$key] = $value; } update($url, http_build_query($fields_mys_wizard)); } */ // remove [remote] section from dynamix.cfg if(!empty($orig['remote'])) { $fields_dyn_remote = [ 'csrf_token' => $var['csrf_token'], '#file' => $dyn_cfg, '#section' => 'remote', '#cleanup' => 'true' ]; foreach($orig['remote'] as $key => $value) { $fields_dyn_remote[$key] = ''; } update($url, http_build_query($fields_dyn_remote)); } // remove [wizard] section from dynamix.cfg if(!empty($orig['wizard'])) { $fields_dyn_wizard = [ 'csrf_token' => $var['csrf_token'], '#file' => $dyn_cfg, '#section' => 'wizard', '#cleanup' => 'true' ]; foreach($orig['wizard'] as $key => $value) { $fields_dyn_wizard[$key] = ''; } update($url, http_build_query($fields_dyn_wizard)); } // remove [remote] and [wizard] section headings from dyn_cfg file $oldtext = file_get_contents($dyn_cfg); $newtext = preg_replace ('/\[(remote|wizard)\]\n/', '', $oldtext); if (strcmp($oldtext, $newtext) !== 0) { file_put_contents($dyn_cfg, $newtext); } } if (!file_exists($mys_cfg)) touch($mys_cfg); ?>