mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
block the login in the controller as well
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
0010a6cfa3
commit
f6fc87354d
1 changed files with 6 additions and 1 deletions
|
|
@ -12,12 +12,17 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
class LoginController
|
class LoginController
|
||||||
{
|
{
|
||||||
private AuthManager $authManager;
|
private AuthManager $authManager;
|
||||||
|
private DockerActionManager $dockerActionManager;
|
||||||
|
|
||||||
public function __construct(AuthManager $authManager) {
|
public function __construct(AuthManager $authManager, DockerActionManager $dockerActionManager) {
|
||||||
$this->authManager = $authManager;
|
$this->authManager = $authManager;
|
||||||
|
$this->dockerActionManager = $dockerActionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function TryLogin(Request $request, Response $response, $args) : Response {
|
public function TryLogin(Request $request, Response $response, $args) : Response {
|
||||||
|
if (!$this->dockerActionManager->isLoginAllowed()) {
|
||||||
|
return $response->withHeader('Location', '/')->withStatus(302);
|
||||||
|
}
|
||||||
$password = $request->getParsedBody()['password'];
|
$password = $request->getParsedBody()['password'];
|
||||||
if($this->authManager->CheckCredentials($password)) {
|
if($this->authManager->CheckCredentials($password)) {
|
||||||
$this->authManager->SetAuthState(true);
|
$this->authManager->SetAuthState(true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue