mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Autologin: Do not require a bogus password in the source code
This commit is contained in:
parent
63fc8eb27e
commit
7215ba4f59
@ -63,8 +63,6 @@ class AuthenticationController extends ActionController
|
|||||||
$this->view->form = new LoginForm();
|
$this->view->form = new LoginForm();
|
||||||
$this->view->form->setRequest($this->_request);
|
$this->view->form->setRequest($this->_request);
|
||||||
$this->view->title = $this->translate('Icingaweb Login');
|
$this->view->title = $this->translate('Icingaweb Login');
|
||||||
$user = new User('');
|
|
||||||
$password = '';
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$redirectUrl = Url::fromPath($this->_request->getParam('redirect', 'dashboard'));
|
$redirectUrl = Url::fromPath($this->_request->getParam('redirect', 'dashboard'));
|
||||||
@ -95,9 +93,10 @@ class AuthenticationController extends ActionController
|
|||||||
|
|
||||||
|
|
||||||
if ($this->getRequest()->isGet()) {
|
if ($this->getRequest()->isGet()) {
|
||||||
|
$user = new User('');
|
||||||
foreach ($chain as $backend) {
|
foreach ($chain as $backend) {
|
||||||
if ($backend instanceof AutoLoginBackend) {
|
if ($backend instanceof AutoLoginBackend) {
|
||||||
$authenticated = $backend->authenticate($user, $password);
|
$authenticated = $backend->authenticate($user);
|
||||||
if ($authenticated === true) {
|
if ($authenticated === true) {
|
||||||
$auth->setAuthenticated($user);
|
$auth->setAuthenticated($user);
|
||||||
$this->redirectNow($redirectUrl);
|
$this->redirectNow($redirectUrl);
|
||||||
|
@ -75,7 +75,7 @@ class AutoLoginBackend extends UserBackend
|
|||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function authenticate(User $user, $password)
|
public function authenticate(User $user, $password = null)
|
||||||
{
|
{
|
||||||
return $this->hasUser($user);
|
return $this->hasUser($user);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user