fix: [internal] Keep OidcAuth setting when modify setting value from UI

pull/7213/head
Jakub Onderka 2021-03-16 20:37:23 +01:00
parent 805b046760
commit 8d03ba7dc1
1 changed files with 17 additions and 17 deletions

View File

@ -2191,7 +2191,7 @@ class Server extends AppModel
$this->Log->save(array( $this->Log->save(array(
'org' => 'SYSTEM', 'org' => 'SYSTEM',
'model' => 'Server', 'model' => 'Server',
'model_id' => $id, 'model_id' => 0,
'email' => 'SYSTEM', 'email' => 'SYSTEM',
'action' => 'error', 'action' => 'error',
'user_id' => 0, 'user_id' => 0,
@ -2234,7 +2234,7 @@ class Server extends AppModel
'debug', 'MISP', 'GnuPG', 'SMIME', 'Proxy', 'SecureAuth', 'debug', 'MISP', 'GnuPG', 'SMIME', 'Proxy', 'SecureAuth',
'Security', 'Session.defaults', 'Session.timeout', 'Session.cookieTimeout', 'Security', 'Session.defaults', 'Session.timeout', 'Session.cookieTimeout',
'Session.autoRegenerate', 'Session.checkAgent', 'site_admin_debug', 'Session.autoRegenerate', 'Session.checkAgent', 'site_admin_debug',
'Plugin', 'CertAuth', 'ApacheShibbAuth', 'ApacheSecureAuth' 'Plugin', 'CertAuth', 'ApacheShibbAuth', 'ApacheSecureAuth', 'OidcAuth',
); );
$settingsArray = array(); $settingsArray = array();
foreach ($settingsToSave as $setting) { foreach ($settingsToSave as $setting) {
@ -2247,7 +2247,7 @@ class Server extends AppModel
} }
if (empty(Configure::read('MISP.server_settings_skip_backup_rotate'))) { if (empty(Configure::read('MISP.server_settings_skip_backup_rotate'))) {
$randomFilename = $this->generateRandomFileName(); $randomFilename = $this->generateRandomFileName();
// To protect us from 2 admin users having a concurent file write to the config file, solar flares and the bogeyman // To protect us from 2 admin users having a concurrent file write to the config file, solar flares and the bogeyman
file_put_contents(APP . 'Config' . DS . $randomFilename, $settingsString); file_put_contents(APP . 'Config' . DS . $randomFilename, $settingsString);
rename(APP . 'Config' . DS . $randomFilename, APP . 'Config' . DS . 'config.php'); rename(APP . 'Config' . DS . $randomFilename, APP . 'Config' . DS . 'config.php');
$config_saved = file_get_contents(APP . 'Config' . DS . 'config.php'); $config_saved = file_get_contents(APP . 'Config' . DS . 'config.php');
@ -2259,7 +2259,7 @@ class Server extends AppModel
$this->Log->save(array( $this->Log->save(array(
'org' => 'SYSTEM', 'org' => 'SYSTEM',
'model' => 'Server', 'model' => 'Server',
'model_id' => $id, 'model_id' => 0,
'email' => 'SYSTEM', 'email' => 'SYSTEM',
'action' => 'error', 'action' => 'error',
'user_id' => 0, 'user_id' => 0,