parent
40d31d02bd
commit
07849e0fea
|
@ -6,7 +6,7 @@ namespace Icinga\Forms;
|
|||
use Exception;
|
||||
use DateTimeZone;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Authentication\Manager;
|
||||
use Icinga\Authentication\Auth;
|
||||
use Icinga\User\Preferences;
|
||||
use Icinga\User\Preferences\PreferencesStore;
|
||||
use Icinga\Util\TimezoneDetect;
|
||||
|
@ -123,7 +123,7 @@ class PreferenceForm extends Form
|
|||
*/
|
||||
public function onRequest()
|
||||
{
|
||||
$auth = Manager::getInstance();
|
||||
$auth = Auth::getInstance();
|
||||
$values = $auth->getUser()->getPreferences()->get('icingaweb');
|
||||
|
||||
if (! isset($values['language'])) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use Icinga\Web\Url;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Authentication\Manager as Auth;
|
||||
use Icinga\Authentication\Auth;
|
||||
|
||||
|
||||
if (Auth::getInstance()->isAuthenticated()):
|
||||
|
|
|
@ -12,7 +12,7 @@ use Zend_Layout;
|
|||
use Zend_Paginator;
|
||||
use Zend_View_Helper_PaginationControl;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Authentication\Manager;
|
||||
use Icinga\Authentication\Auth;
|
||||
use Icinga\User;
|
||||
use Icinga\Util\TimezoneDetect;
|
||||
use Icinga\Util\Translator;
|
||||
|
@ -179,7 +179,7 @@ class Web extends ApplicationBootstrap
|
|||
*/
|
||||
private function setupUser()
|
||||
{
|
||||
$auth = Manager::getInstance();
|
||||
$auth = Auth::getInstance();
|
||||
if ($auth->isAuthenticated()) {
|
||||
$this->user = $auth->getUser();
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ class Web extends ApplicationBootstrap
|
|||
*/
|
||||
protected function detectTimezone()
|
||||
{
|
||||
$auth = Manager::getInstance();
|
||||
$auth = Auth::getInstance();
|
||||
if (! $auth->isAuthenticated()
|
||||
|| ($timezone = $auth->getUser()->getPreferences()->getValue('icingaweb', 'timezone')) === null
|
||||
) {
|
||||
|
@ -303,7 +303,7 @@ class Web extends ApplicationBootstrap
|
|||
*/
|
||||
protected function detectLocale()
|
||||
{
|
||||
$auth = Manager::getInstance();
|
||||
$auth = Auth::getInstance();
|
||||
if ($auth->isAuthenticated()
|
||||
&& ($locale = $auth->getUser()->getPreferences()->getValue('icingaweb', 'language')) !== null
|
||||
) {
|
||||
|
|
|
@ -15,7 +15,7 @@ use Icinga\User\Preferences;
|
|||
use Icinga\User\Preferences\PreferencesStore;
|
||||
use Icinga\Web\Session;
|
||||
|
||||
class Manager
|
||||
class Auth
|
||||
{
|
||||
/**
|
||||
* Singleton instance
|
||||
|
@ -44,7 +44,7 @@ class Manager
|
|||
public static function getInstance()
|
||||
{
|
||||
if (self::$instance === null) {
|
||||
self::$instance = new static();
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
|
@ -6,7 +6,7 @@ namespace Icinga\Web\Controller;
|
|||
use Exception;
|
||||
use Icinga\Application\Benchmark;
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Authentication\Manager;
|
||||
use Icinga\Authentication\Auth;
|
||||
use Icinga\Exception\Http\HttpMethodNotAllowedException;
|
||||
use Icinga\Exception\IcingaException;
|
||||
use Icinga\Exception\ProgrammingError;
|
||||
|
@ -52,7 +52,7 @@ class ActionController extends Zend_Controller_Action
|
|||
/**
|
||||
* Authentication manager
|
||||
*
|
||||
* @var Manager|null
|
||||
* @var Auth|null
|
||||
*/
|
||||
private $auth;
|
||||
|
||||
|
@ -124,12 +124,12 @@ class ActionController extends Zend_Controller_Action
|
|||
/**
|
||||
* Get the authentication manager
|
||||
*
|
||||
* @return Manager
|
||||
* @return Auth
|
||||
*/
|
||||
public function Auth()
|
||||
{
|
||||
if ($this->auth === null) {
|
||||
$this->auth = Manager::getInstance();
|
||||
$this->auth = Auth::getInstance();
|
||||
}
|
||||
return $this->auth;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ use Zend_Form;
|
|||
use Zend_Form_Element;
|
||||
use Zend_View_Interface;
|
||||
use Icinga\Application\Icinga;
|
||||
use Icinga\Authentication\Manager;
|
||||
use Icinga\Authentication\Auth;
|
||||
use Icinga\Exception\ProgrammingError;
|
||||
use Icinga\Security\SecurityException;
|
||||
use Icinga\Util\Translator;
|
||||
|
@ -179,7 +179,7 @@ class Form extends Zend_Form
|
|||
/**
|
||||
* Authentication manager
|
||||
*
|
||||
* @var Manager|null
|
||||
* @var Auth|null
|
||||
*/
|
||||
private $auth;
|
||||
|
||||
|
@ -1344,12 +1344,12 @@ class Form extends Zend_Form
|
|||
/**
|
||||
* Get the authentication manager
|
||||
*
|
||||
* @return Manager
|
||||
* @return Auth
|
||||
*/
|
||||
public function Auth()
|
||||
{
|
||||
if ($this->auth === null) {
|
||||
$this->auth = Manager::getInstance();
|
||||
$this->auth = Auth::getInstance();
|
||||
}
|
||||
return $this->auth;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ use RecursiveIterator;
|
|||
use Icinga\Application\Config;
|
||||
use Icinga\Application\Icinga;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Authentication\Manager;
|
||||
use Icinga\Authentication\Auth;
|
||||
use Icinga\Data\ConfigObject;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
use Icinga\Exception\ProgrammingError;
|
||||
|
@ -208,7 +208,7 @@ class Menu implements RecursiveIterator
|
|||
{
|
||||
$menu = new static('menu');
|
||||
$menu->addMainMenuItems();
|
||||
$auth = Manager::getInstance();
|
||||
$auth = Auth::getInstance();
|
||||
$manager = Icinga::app()->getModuleManager();
|
||||
foreach ($manager->getLoadedModules() as $module) {
|
||||
if ($auth->hasPermission($manager::MODULE_PERMISSION_NS . $module->getName())) {
|
||||
|
@ -223,7 +223,7 @@ class Menu implements RecursiveIterator
|
|||
*/
|
||||
protected function addMainMenuItems()
|
||||
{
|
||||
$auth = Manager::getInstance();
|
||||
$auth = Auth::getInstance();
|
||||
|
||||
if ($auth->isAuthenticated()) {
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Icinga\Web\Menu;
|
||||
|
||||
use RecursiveFilterIterator;
|
||||
use Icinga\Authentication\Manager;
|
||||
use Icinga\Authentication\Auth;
|
||||
use Icinga\Web\Menu;
|
||||
|
||||
class PermittedMenuItemFilter extends RecursiveFilterIterator
|
||||
|
@ -18,7 +18,7 @@ class PermittedMenuItemFilter extends RecursiveFilterIterator
|
|||
$item = $this->current();
|
||||
/** @var Menu $item */
|
||||
if (($permission = $item->getPermission()) !== null) {
|
||||
$auth = Manager::getInstance();
|
||||
$auth = Auth::getInstance();
|
||||
if (! $auth->isAuthenticated()) {
|
||||
// Don't accept menu item because user is not authenticated and the menu item requires a permission
|
||||
return false;
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Icinga\Web;
|
|||
|
||||
use Closure;
|
||||
use Zend_View_Abstract;
|
||||
use Icinga\Authentication\Manager;
|
||||
use Icinga\Authentication\Auth;
|
||||
use Icinga\Exception\ProgrammingError;
|
||||
use Icinga\Util\Translator;
|
||||
|
||||
|
@ -39,7 +39,7 @@ class View extends Zend_View_Abstract
|
|||
/**
|
||||
* Authentication manager
|
||||
*
|
||||
* @var \Icinga\Authentication\Manager|null
|
||||
* @var Auth|null
|
||||
*/
|
||||
private $auth;
|
||||
|
||||
|
@ -164,12 +164,12 @@ class View extends Zend_View_Abstract
|
|||
/**
|
||||
* Get the authentication manager
|
||||
*
|
||||
* @return Manager
|
||||
* @return Auth
|
||||
*/
|
||||
public function Auth()
|
||||
{
|
||||
if ($this->auth === null) {
|
||||
$this->auth = Manager::getInstance();
|
||||
$this->auth = Auth::getInstance();
|
||||
}
|
||||
return $this->auth;
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
namespace Icinga\Web\View;
|
||||
|
||||
use Icinga\Authentication\Manager;
|
||||
use Icinga\Authentication\Auth;
|
||||
use Icinga\Web\Widget;
|
||||
|
||||
$this->addHelperFunction('auth', function () {
|
||||
return Manager::getInstance();
|
||||
return Auth::getInstance();
|
||||
});
|
||||
|
||||
$this->addHelperFunction('widget', function ($name, $options = null) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
namespace Icinga\Module\Monitoring\Web\Menu;
|
||||
|
||||
use Icinga\Authentication\Manager;
|
||||
use Icinga\Authentication\Auth;
|
||||
use Icinga\Data\Filter\Filter;
|
||||
use Icinga\Data\Filterable;
|
||||
use Icinga\Web\Menu;
|
||||
|
@ -27,7 +27,7 @@ class MonitoringMenuItemRenderer extends MenuItemRenderer
|
|||
protected static function applyRestriction($restriction, Filterable $filterable)
|
||||
{
|
||||
$restrictions = Filter::matchAny();
|
||||
foreach (Manager::getInstance()->getRestrictions($restriction) as $filter) {
|
||||
foreach (Auth::getInstance()->getRestrictions($restriction) as $filter) {
|
||||
$restrictions->addFilter(Filter::fromQueryString($filter));
|
||||
}
|
||||
$filterable->applyFilter($restrictions);
|
||||
|
|
Loading…
Reference in New Issue