From 14a4aaeb776d470ad670151aa609238aa1fb1a5b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 23 Jan 2015 15:23:43 +0100 Subject: [PATCH] Revert "Fix that when chosing to not to store preferences an invalid config is created" This reverts commit 6284da451e2a3f1fecf8935f04701d889445203c. --- application/forms/Config/General/ApplicationConfigForm.php | 4 ++-- library/Icinga/Authentication/Manager.php | 5 +++-- modules/setup/application/forms/PreferencesPage.php | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/application/forms/Config/General/ApplicationConfigForm.php b/application/forms/Config/General/ApplicationConfigForm.php index 6d00a5b47..8f718ccdf 100644 --- a/application/forms/Config/General/ApplicationConfigForm.php +++ b/application/forms/Config/General/ApplicationConfigForm.php @@ -48,13 +48,13 @@ class ApplicationConfigForm extends Form 'select', 'preferences_type', array( - 'allowEmpty' => true, + 'required' => true, 'autosubmit' => true, 'label' => $this->translate('User Preference Storage Type'), 'multiOptions' => array( 'ini' => $this->translate('File System (INI Files)'), 'db' => $this->translate('Database'), - '' => $this->translate('Don\'t Store Preferences') + 'null' => $this->translate('Don\'t Store Preferences') ) ) ); diff --git a/library/Icinga/Authentication/Manager.php b/library/Icinga/Authentication/Manager.php index 887c9674d..12269d98e 100644 --- a/library/Icinga/Authentication/Manager.php +++ b/library/Icinga/Authentication/Manager.php @@ -63,10 +63,11 @@ class Manager ); $config = new Config(); } - if ($config->get('preferences', 'type')) { + if ($config->hasSection('preferences')) { + $preferencesConfig = $config->getSection('preferences'); try { $preferencesStore = PreferencesStore::create( - $config->getSection('preferences'), + $preferencesConfig, $user ); $preferences = new Preferences($preferencesStore->load()); diff --git a/modules/setup/application/forms/PreferencesPage.php b/modules/setup/application/forms/PreferencesPage.php index 1309f59f9..07e011ee1 100644 --- a/modules/setup/application/forms/PreferencesPage.php +++ b/modules/setup/application/forms/PreferencesPage.php @@ -66,13 +66,13 @@ class PreferencesPage extends Form if (Platform::hasMysqlSupport() || Platform::hasPostgresqlSupport()) { $storageTypes['db'] = $this->translate('Database'); } - $storageTypes[''] = $this->translate('Don\'t Store Preferences'); + $storageTypes['null'] = $this->translate('Don\'t Store Preferences'); $this->addElement( 'select', 'type', array( - 'allowEmpty' => true, + 'required' => true, 'label' => $this->translate('User Preference Storage Type'), 'multiOptions' => $storageTypes )