Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/time-tooltip-7328
Browse files Browse the repository at this point in the history
  • Loading branch information
lippserd committed Oct 31, 2014
2 parents e0b3dce + b38e3af commit 21743e4
Show file tree
Hide file tree
Showing 41 changed files with 154 additions and 152 deletions.
3 changes: 1 addition & 2 deletions application/controllers/AuthenticationController.php
Expand Up @@ -9,7 +9,7 @@
use Icinga\Form\Authentication\LoginForm;
use Icinga\Authentication\AuthChain;
use Icinga\Application\Config;
use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Icinga\Exception\AuthenticationException;
use Icinga\Exception\NotReadableError;
use Icinga\Exception\ConfigurationError;
Expand Down Expand Up @@ -148,7 +148,6 @@ public function logoutAction()
$isRemoteUser = $auth->getUser()->isRemoteUser();
$auth->removeAuthorization();
if ($isRemoteUser === true) {
$this->_helper->layout->setLayout('login');
$this->_response->setHttpResponseCode(401);
} else {
$this->redirectToLogin();
Expand Down
24 changes: 12 additions & 12 deletions application/controllers/DashboardController.php
Expand Up @@ -2,16 +2,16 @@
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}

use Icinga\Web\Url;
use Icinga\Logger\Logger;
use Icinga\Config\PreservingIniWriter;
use Icinga\Application\Config as IcingaConfig;
use Icinga\Web\Widget\Dashboard;
use Icinga\Form\Dashboard\AddUrlForm;
use Icinga\Exception\NotReadableError;
use Icinga\Application\Config;
use Icinga\Application\Logger;
use Icinga\Exception\ConfigurationError;
use Icinga\Web\Controller\ActionController;
use Icinga\Exception\IcingaException;
use Icinga\Exception\NotReadableError;
use Icinga\File\Ini\IniWriter;
use Icinga\Form\Dashboard\AddUrlForm;
use Icinga\Web\Controller\ActionController;
use Icinga\Web\Url;
use Icinga\Web\Widget\Dashboard;

/**
* Handle creation, removal and displaying of dashboards, panes and components
Expand All @@ -36,7 +36,7 @@ private function getDashboard($config = self::DEFAULT_CONFIG)
{
$dashboard = new Dashboard();
try {
$dashboardConfig = IcingaConfig::app($config);
$dashboardConfig = Config::app($config);
if (count($dashboardConfig) === 0) {
return null;
}
Expand Down Expand Up @@ -92,7 +92,7 @@ public function addurlAction()
ltrim($form->getValue('url'), '/')
);

$configFile = IcingaConfig::app('dashboard/dashboard')->getConfigFile();
$configFile = Config::app('dashboard/dashboard')->getConfigFile();
if ($this->writeConfiguration(new Zend_Config($dashboard->toArray()), $configFile)) {
$this->redirectNow(Url::fromPath('dashboard', array('pane' => $form->getValue('pane'))));
} else {
Expand Down Expand Up @@ -125,7 +125,7 @@ public function indexAction()
$dashboard->activate($pane);
}

$this->view->configPath = IcingaConfig::resolvePath(self::DEFAULT_CONFIG);
$this->view->configPath = Config::resolvePath(self::DEFAULT_CONFIG);

if ($dashboard === null) {
$this->view->title = 'Dashboard';
Expand Down Expand Up @@ -158,7 +158,7 @@ public function indexAction()
*/
protected function writeConfiguration(Zend_Config $config, $target)
{
$writer = new PreservingIniWriter(array('config' => $config, 'filename' => $target));
$writer = new IniWriter(array('config' => $config, 'filename' => $target));

try {
$writer->write();
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/ErrorController.php
Expand Up @@ -4,7 +4,7 @@

// namespace Icinga\Application\Controllers;

use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Icinga\Web\Controller\ActionController;
use Icinga\Application\Icinga;

Expand Down
2 changes: 1 addition & 1 deletion application/controllers/FilterController.php
Expand Up @@ -4,7 +4,7 @@

use Icinga\Web\Controller\ActionController;
use Icinga\Filter\Filter;
use Icinga\Logger\Logger;
use Icinga\Application\Logger;

/**
* Application wide interface for filtering
Expand Down
4 changes: 1 addition & 3 deletions application/controllers/ListController.php
Expand Up @@ -5,9 +5,7 @@
use Icinga\Module\Monitoring\Controller;
use Icinga\Web\Hook;
use Icinga\Web\Url;
use Icinga\Data\ResourceFactory;
use Icinga\Logger\Logger;
use Icinga\Logger\Writer\FileWriter;
use Icinga\Application\Logger;
use Icinga\Protocol\File\FileReader;
use \Zend_Controller_Action_Exception as ActionError;

Expand Down
2 changes: 1 addition & 1 deletion application/controllers/StaticController.php
Expand Up @@ -4,7 +4,7 @@

use Icinga\Web\Controller\ActionController;
use Icinga\Application\Icinga;
use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Icinga\Web\FileCache;
use Zend_Controller_Action_Exception as ActionException;

Expand Down
2 changes: 1 addition & 1 deletion application/forms/Config/General/LoggingConfigForm.php
Expand Up @@ -5,7 +5,7 @@
namespace Icinga\Form\Config\General;

use Icinga\Application\Icinga;
use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Icinga\Web\Form;
use Icinga\Web\Form\Validator\WritablePathValidator;

Expand Down
4 changes: 2 additions & 2 deletions application/forms/ConfigForm.php
Expand Up @@ -7,7 +7,7 @@
use Exception;
use Icinga\Web\Form;
use Icinga\Application\Config;
use Icinga\Config\PreservingIniWriter;
use Icinga\File\Ini\IniWriter;

/**
* Form base-class providing standard functionality for configuration forms
Expand Down Expand Up @@ -43,7 +43,7 @@ public function setIniConfig(Config $config)
*/
public function save()
{
$writer = new PreservingIniWriter(
$writer = new IniWriter(
array(
'config' => $this->config,
'filename' => $this->config->getConfigFile()
Expand Down
12 changes: 7 additions & 5 deletions application/forms/PreferenceForm.php
Expand Up @@ -6,14 +6,15 @@

use Exception;
use DateTimeZone;
use Icinga\Application\Logger;
use Icinga\User\Preferences;
use Icinga\User\Preferences\PreferencesStore;
use Icinga\Util\TimezoneDetect;
use Icinga\Util\Translator;
use Icinga\Web\Form;
use Icinga\Web\Notification;
use Icinga\Web\Request;
use Icinga\Web\Session;
use Icinga\Web\Notification;
use Icinga\Util\Translator;
use Icinga\Util\TimezoneDetect;
use Icinga\User\Preferences;
use Icinga\User\Preferences\PreferencesStore;

/**
* Form class to adjust user preferences
Expand Down Expand Up @@ -108,6 +109,7 @@ public function onSuccess(Request $request)
$this->save();
Notification::success(t('Preferences successfully saved'));
} catch (Exception $e) {
Logger::error($e);
Notification::error($e->getMessage());
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Application/ApplicationBootstrap.php
Expand Up @@ -11,7 +11,7 @@
use Icinga\Data\ResourceFactory;
use Icinga\Exception\ConfigurationError;
use Icinga\Exception\NotReadableError;
use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Icinga\Util\DateTimeFactory;
use Icinga\Util\Translator;
use Icinga\Exception\IcingaException;
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Application/Cli.php
Expand Up @@ -9,7 +9,7 @@
use Icinga\Cli\Params;
use Icinga\Cli\Loader;
use Icinga\Cli\Screen;
use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Icinga\Application\Benchmark;
use Icinga\Exception\ProgrammingError;
use Zend_Config;
Expand Down
Expand Up @@ -2,13 +2,13 @@
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}

namespace Icinga\Logger;
namespace Icinga\Application;

use Exception;
use Zend_Config;
use Icinga\Application\Logger\Writer\FileWriter;
use Icinga\Application\Logger\Writer\SyslogWriter;
use Icinga\Exception\ConfigurationError;
use Icinga\Logger\Writer\FileWriter;
use Icinga\Logger\Writer\SyslogWriter;

/**
* Logger
Expand Down Expand Up @@ -57,7 +57,7 @@ class Logger
/**
* Log writer
*
* @var \Icinga\Logger\LogWriter
* @var \Icinga\Application\Logger\LogWriter
*/
protected $writer;

Expand Down Expand Up @@ -133,12 +133,12 @@ public static function create(Zend_Config $config)
*
* @param Zend_Config $config The configuration to initialize the writer with
*
* @return \Icinga\Logger\LogWriter The requested log writer
* @throws ConfigurationError If the requested writer cannot be found
* @return \Icinga\Application\Logger\LogWriter The requested log writer
* @throws ConfigurationError If the requested writer cannot be found
*/
protected function createWriter(Zend_Config $config)
{
$class = 'Icinga\\Logger\\Writer\\' . ucfirst(strtolower($config->log)) . 'Writer';
$class = 'Icinga\\Application\\Logger\\Writer\\' . ucfirst(strtolower($config->log)) . 'Writer';
if (! class_exists($class)) {
throw new ConfigurationError(
'Cannot find log writer of type "%s"',
Expand All @@ -156,7 +156,7 @@ protected function createWriter(Zend_Config $config)
*/
public function log($level, $message)
{
if ($this->writer !== null && $this->level >= $level) {
if ($this->writer !== null && $this->level <= $level) {
$this->writer->log($level, $message);
}
}
Expand Down Expand Up @@ -258,7 +258,7 @@ public static function debug()
/**
* Get the log writer to use
*
* @return \Icinga\Logger\LogWriter
* @return \Icinga\Application\Logger\LogWriter
*/
public function getWriter()
{
Expand Down
Expand Up @@ -2,7 +2,7 @@
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}

namespace Icinga\Logger;
namespace Icinga\Application\Logger;

use Zend_Config;

Expand Down
Expand Up @@ -2,13 +2,13 @@
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}

namespace Icinga\Logger\Writer;
namespace Icinga\Application\Logger\Writer;

use Exception;
use Zend_Config;
use Icinga\Application\Logger;
use Icinga\Application\Logger\LogWriter;
use Icinga\Exception\ConfigurationError;
use Icinga\Logger\Logger;
use Icinga\Logger\LogWriter;
use Icinga\Util\File;

/**
Expand Down
Expand Up @@ -2,11 +2,11 @@
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}

namespace Icinga\Logger\Writer;
namespace Icinga\Application\Logger\Writer;

use Zend_Config;
use Icinga\Logger\Logger;
use Icinga\Logger\LogWriter;
use Icinga\Application\Logger;
use Icinga\Application\Logger\LogWriter;

/**
* Log to the syslog service
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Application/Modules/Manager.php
Expand Up @@ -6,7 +6,7 @@

use Icinga\Application\ApplicationBootstrap;
use Icinga\Application\Icinga;
use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Icinga\Data\DataArray\ArrayDatasource;
use Icinga\Data\SimpleQuery;
use Icinga\Exception\ConfigurationError;
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Application/Modules/Module.php
Expand Up @@ -12,7 +12,7 @@
use Icinga\Application\ApplicationBootstrap;
use Icinga\Application\Config;
use Icinga\Application\Icinga;
use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Icinga\Util\Translator;
use Icinga\Web\Hook;
use Icinga\Web\Menu;
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Application/Web.php
Expand Up @@ -9,7 +9,7 @@
use Icinga\Authentication\Manager as AuthenticationManager;
use Icinga\Exception\ConfigurationError;
use Icinga\Exception\NotReadableError;
use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Icinga\Util\TimezoneDetect;
use Icinga\Web\Request;
use Icinga\Web\Response;
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Authentication/AuthChain.php
Expand Up @@ -6,7 +6,7 @@

use Iterator;
use Zend_Config;
use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Icinga\Exception\ConfigurationError;

/**
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Authentication/Backend/LdapUserBackend.php
Expand Up @@ -4,7 +4,7 @@

namespace Icinga\Authentication\Backend;

use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Icinga\User;
use Icinga\Authentication\UserBackend;
use Icinga\Protocol\Ldap\Connection;
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Authentication/Manager.php
Expand Up @@ -9,7 +9,7 @@
use Icinga\Application\Config;
use Icinga\Exception\IcingaException;
use Icinga\Exception\NotReadableError;
use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Icinga\User;
use Icinga\User\Preferences;
use Icinga\User\Preferences\PreferencesStore;
Expand Down
Expand Up @@ -2,7 +2,7 @@
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}

namespace Icinga\Config;
namespace Icinga\File\Ini;

/**
* Edit the sections and keys of an ini in-place
Expand Down
Expand Up @@ -2,17 +2,16 @@
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}

namespace Icinga\Config;
namespace Icinga\File\Ini;

use Zend_Config;
use Zend_Config_Ini;
use Zend_Config_Writer_FileAbstract;
use Icinga\Config\IniEditor;

/**
* A ini file adapter that respects the file structure and the comments of already existing ini files
* A INI file adapter that respects the file structure and the comments of already existing ini files
*/
class PreservingIniWriter extends Zend_Config_Writer_FileAbstract
class IniWriter extends Zend_Config_Writer_FileAbstract
{
/**
* Stores the options
Expand All @@ -22,7 +21,7 @@ class PreservingIniWriter extends Zend_Config_Writer_FileAbstract
protected $options;

/**
* Create a new PreservingIniWriter
* Create a new INI writer
*
* @param array $options Supports all options of Zend_Config_Writer and additional
* options for the internal IniEditor:
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Protocol/Ldap/Connection.php
Expand Up @@ -7,7 +7,7 @@
use Icinga\Protocol\Ldap\Exception as LdapException;
use Icinga\Application\Platform;
use Icinga\Application\Config;
use Icinga\Logger\Logger;
use Icinga\Application\Logger;
use Zend_Config;

/**
Expand Down

0 comments on commit 21743e4

Please sign in to comment.