mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +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
|
||||
{
|
||||
private AuthManager $authManager;
|
||||
private DockerActionManager $dockerActionManager;
|
||||
|
||||
public function __construct(AuthManager $authManager) {
|
||||
public function __construct(AuthManager $authManager, DockerActionManager $dockerActionManager) {
|
||||
$this->authManager = $authManager;
|
||||
$this->dockerActionManager = $dockerActionManager;
|
||||
}
|
||||
|
||||
public function TryLogin(Request $request, Response $response, $args) : Response {
|
||||
if (!$this->dockerActionManager->isLoginAllowed()) {
|
||||
return $response->withHeader('Location', '/')->withStatus(302);
|
||||
}
|
||||
$password = $request->getParsedBody()['password'];
|
||||
if($this->authManager->CheckCredentials($password)) {
|
||||
$this->authManager->SetAuthState(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue