diff --git a/application/controllers/PreferenceController.php b/application/controllers/PreferenceController.php index 7acab7c25..c45344fbf 100644 --- a/application/controllers/PreferenceController.php +++ b/application/controllers/PreferenceController.php @@ -7,7 +7,6 @@ use Icinga\Web\Url; use Icinga\Web\Widget\Tab; use Icinga\Application\Config; use Icinga\Forms\PreferenceForm; -use Icinga\Exception\ConfigurationError; use Icinga\User\Preferences\PreferencesStore; /** @@ -40,9 +39,6 @@ class PreferenceController extends BasePreferenceController public function indexAction() { $storeConfig = Config::app()->getSection('preferences'); - if ($storeConfig->isEmpty()) { - throw new ConfigurationError(t('You need to configure how to store preferences first.')); - } $user = $this->getRequest()->getUser(); $form = new PreferenceForm(); diff --git a/library/Icinga/Authentication/Manager.php b/library/Icinga/Authentication/Manager.php index 12269d98e..8aee93c0e 100644 --- a/library/Icinga/Authentication/Manager.php +++ b/library/Icinga/Authentication/Manager.php @@ -63,7 +63,7 @@ class Manager ); $config = new Config(); } - if ($config->hasSection('preferences')) { + if ($config->get('preferences', 'store', 'ini') !== 'none') { $preferencesConfig = $config->getSection('preferences'); try { $preferencesStore = PreferencesStore::create( diff --git a/library/Icinga/User/Preferences/PreferencesStore.php b/library/Icinga/User/Preferences/PreferencesStore.php index a9d9ec033..11454a2f8 100644 --- a/library/Icinga/User/Preferences/PreferencesStore.php +++ b/library/Icinga/User/Preferences/PreferencesStore.php @@ -117,13 +117,7 @@ abstract class PreferencesStore */ public static function create(ConfigObject $config, User $user) { - if (($type = $config->store) === null) { - throw new ConfigurationError( - 'Preferences configuration is missing the store directive' - ); - } - - $type = ucfirst(strtolower($type)); + $type = ucfirst(strtolower($config->get('store', 'ini'))); $storeClass = 'Icinga\\User\\Preferences\\Store\\' . $type . 'Store'; if (!class_exists($storeClass)) { throw new ConfigurationError(