mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-24 22:34:24 +02:00
parent
658fbd0584
commit
6eade9c023
@ -1,8 +1,8 @@
|
|||||||
[localdb]
|
[localdb]
|
||||||
type = ido
|
type = ido
|
||||||
host = localhost
|
host = localhost
|
||||||
user = "icinga-idoutils"
|
user = "icinga"
|
||||||
pass = "Secret"
|
pass = "icinga"
|
||||||
db = "icinga"
|
db = "icinga"
|
||||||
|
|
||||||
[locallive]
|
[locallive]
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
namespace Icinga\Application;
|
namespace Icinga\Application;
|
||||||
|
|
||||||
use Icinga\Authentication\Manager;
|
use Icinga\Authentication\Manager;
|
||||||
use Icinga\Web\Session;
|
|
||||||
use Zend_Controller_Front as FrontController;
|
use Zend_Controller_Front as FrontController;
|
||||||
use Zend_Layout as Layout;
|
use Zend_Layout as Layout;
|
||||||
use Zend_Paginator as Paginator;
|
use Zend_Paginator as Paginator;
|
||||||
@ -93,7 +92,7 @@ class Web extends ApplicationBootstrap
|
|||||||
|
|
||||||
protected function loadTranslations()
|
protected function loadTranslations()
|
||||||
{
|
{
|
||||||
// Session::getInstance()->language;
|
// AuthManager::getInstance()->getSession()->language;
|
||||||
$locale = null;
|
$locale = null;
|
||||||
if (!$locale) {
|
if (!$locale) {
|
||||||
$locale = 'en_US';
|
$locale = 'en_US';
|
||||||
@ -107,7 +106,7 @@ class Web extends ApplicationBootstrap
|
|||||||
|
|
||||||
protected function dispatchFrontController()
|
protected function dispatchFrontController()
|
||||||
{
|
{
|
||||||
// Session::getInstance();
|
// AuthManager::getInstance()->getSession();
|
||||||
$this->frontController->dispatch();
|
$this->frontController->dispatch();
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ use Icinga\Authentication\User as User;
|
|||||||
use Icinga\Authentication\UserBackend;
|
use Icinga\Authentication\UserBackend;
|
||||||
use Icinga\Authentication\Credentials;
|
use Icinga\Authentication\Credentials;
|
||||||
use Icinga\Protocol\Ldap;
|
use Icinga\Protocol\Ldap;
|
||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config as IcingaConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User authentication backend (@see Icinga\Authentication\UserBackend) for
|
* User authentication backend (@see Icinga\Authentication\UserBackend) for
|
||||||
@ -70,16 +70,10 @@ class LdapUserBackend implements UserBackend
|
|||||||
protected function selectUsername($username)
|
protected function selectUsername($username)
|
||||||
{
|
{
|
||||||
return $this->connection->select()
|
return $this->connection->select()
|
||||||
->from(
|
->from(IcingaConfig::getInstance()->authentication->users->user_class,
|
||||||
Config::getInstance()->authentication->users->user_class,
|
array(IcingaConfig::getInstance()->authentication->users->user_name_attribute))
|
||||||
array(
|
->where(IcingaConfig::getInstance()->authentication->users->user_name_attribute,
|
||||||
Config::getInstance()->authentication->users->user_name_attribute
|
$this->stripAsterisks($username));
|
||||||
)
|
|
||||||
)
|
|
||||||
->where(
|
|
||||||
Config::getInstance()->authentication->users->user_name_attribute,
|
|
||||||
$this->stripAsterisks($username)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -176,7 +176,7 @@ class Manager
|
|||||||
Logger::info("Invalid credentials for user %s provided", $credentials->getUsername());
|
Logger::info("Invalid credentials for user %s provided", $credentials->getUsername());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($persist == true) {
|
if ($persist == true) {
|
||||||
$this->persistCurrentUser();
|
$this->persistCurrentUser();
|
||||||
$this->session->write();
|
$this->session->write();
|
||||||
@ -244,4 +244,9 @@ class Manager
|
|||||||
{
|
{
|
||||||
return $this->user->getGroups();
|
return $this->user->getGroups();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSession()
|
||||||
|
{
|
||||||
|
return $this->session;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Icinga;
|
namespace Icinga;
|
||||||
|
|
||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config;
|
||||||
use Icinga\Web\Session;
|
use Icinga\Authentication\Manager as AuthManager;
|
||||||
|
|
||||||
class Backend
|
class Backend
|
||||||
{
|
{
|
||||||
protected static $instances = array();
|
protected static $instances = array();
|
||||||
|
|
||||||
protected function __construct() {}
|
protected function __construct() {}
|
||||||
|
|
||||||
public static function getInstance($name = null)
|
public static function getInstance($name = null)
|
||||||
@ -14,7 +16,7 @@ class Backend
|
|||||||
if (! array_key_exists($name, self::$instances)) {
|
if (! array_key_exists($name, self::$instances)) {
|
||||||
$config = Config::getInstance()->backends;
|
$config = Config::getInstance()->backends;
|
||||||
if ($name === null) {
|
if ($name === null) {
|
||||||
$name = Session::getInstance()->backend;
|
$name = AuthManager::getInstance()->getSession()->get('backend');
|
||||||
}
|
}
|
||||||
if ($name === null) {
|
if ($name === null) {
|
||||||
$name = array_shift(array_keys($config->toArray()));
|
$name = array_shift(array_keys($config->toArray()));
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
[localdb]
|
[localdb]
|
||||||
type = ido
|
type = ido
|
||||||
host = localhost
|
host = localhost
|
||||||
user = "icinga-idoutils"
|
user = "icinga"
|
||||||
pass = "***"
|
pass = "icinga"
|
||||||
db = "icinga"
|
db = "icinga"
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
namespace Icinga\Monitoring;
|
namespace Icinga\Monitoring;
|
||||||
|
|
||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config;
|
||||||
use Icinga\Web\Session;
|
use Icinga\Authentication\Manager as AuthManager;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
class Backend
|
class Backend
|
||||||
{
|
{
|
||||||
protected static $instances = array();
|
protected static $instances = array();
|
||||||
protected static $backendConfigs;
|
protected static $backendConfigs;
|
||||||
|
|
||||||
final protected function __construct()
|
final protected function __construct()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ class Backend
|
|||||||
} else {
|
} else {
|
||||||
if ($name === null) {
|
if ($name === null) {
|
||||||
// TODO: Remove this, will be chosen by Environment
|
// TODO: Remove this, will be chosen by Environment
|
||||||
$name = Session::getInstance()->backend;
|
$name = AuthManager::getInstance()->getSession()->get('backend');
|
||||||
}
|
}
|
||||||
return self::getBackend($name);
|
return self::getBackend($name);
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
namespace Icinga\Monitoring;
|
namespace Icinga\Monitoring;
|
||||||
|
|
||||||
use Icinga\Application\Config;
|
use Icinga\Application\Config;
|
||||||
use Icinga\Web\Session;
|
|
||||||
use Exception;
|
|
||||||
|
|
||||||
class Environment
|
class Environment
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user