Merge branch 'bugfix/preferences-error-messages-4648'

fixes #4648
This commit is contained in:
Johannes Meyer 2013-08-29 14:51:38 +02:00
commit 32abb20a60
4 changed files with 20 additions and 8 deletions

View File

View File

@ -1 +0,0 @@
# Keep this directory

View File

@ -30,13 +30,13 @@ namespace Icinga\Application;
use \Exception;
use \Zend_Layout;
use \Zend_Config;
use \Zend_Paginator;
use \Zend_View_Helper_PaginationControl;
use \Zend_Controller_Action_HelperBroker;
use \Zend_Controller_Router_Route;
use \Zend_Controller_Action_Helper_ViewRenderer;
use \Zend_Controller_Front;
use \Icinga\Application\Logger;
use \Icinga\Authentication\Manager as AuthenticationManager;
use \Icinga\Exception\ConfigurationError;
use \Icinga\User\Preferences;
@ -249,6 +249,15 @@ class Web extends ApplicationBootstrap
$preferences->attach($sessionStore);
if ($this->getConfig()->preferences !== null) {
if (!$this->getConfig()->preferences->type) {
Logger::info(
'Preferences provider configuration error. No type was omitted. For convenience we enable '
. 'file based ini provider for you.'
);
$this->getConfig()->preferences->type = 'ini';
}
$path = Config::resolvePath($this->getConfig()->preferences->configPath);
if (is_dir($path) === false) {
Logger::error(

View File

@ -28,11 +28,10 @@
namespace Icinga\User\Preferences;
use Icinga\User;
use Icinga\Exception\ProgrammingError;
use \Icinga\Application\DbAdapterFactory;
use \Zend_Config;
use \Zend_Db;
use \Icinga\User;
use \Icinga\Exception\ProgrammingError;
use \Icinga\Application\DbAdapterFactory;
/**
* Create preference stores from zend config
@ -66,7 +65,10 @@ final class StoreFactory
$store = new $class();
if (!$store instanceof FlushObserverInterface) {
throw new ProgrammingError('Not instance of FlushObserverInterface: '. $class);
throw new ProgrammingError(
'Preferences StoreFactory could not create provider (class ' . $class . '). '
. 'Class is not instance of FlushObserverInterface.'
);
}
$items = $config->toArray();
@ -88,6 +90,8 @@ final class StoreFactory
return $store;
}
throw new ProgrammingError('Could not instantiate class: '. $class);
throw new ProgrammingError(
'Preferences StoreFactory could not create provider (class ' . $class . '). Class not found.'
);
}
}