mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
remove the username for the aio interface
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
3a67636092
commit
f07413a182
5 changed files with 6 additions and 18 deletions
|
|
@ -12,14 +12,10 @@ class AuthManager {
|
||||||
$this->configurationManager = $configurationManager;
|
$this->configurationManager = $configurationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function CheckCredentials(string $username, string $password) : bool {
|
public function CheckCredentials(string $password) : bool {
|
||||||
if($username === $this->configurationManager->GetUserName()) {
|
|
||||||
return hash_equals($this->configurationManager->GetPassword(), $password);
|
return hash_equals($this->configurationManager->GetPassword(), $password);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function CheckToken(string $token) : bool {
|
public function CheckToken(string $token) : bool {
|
||||||
return hash_equals($this->configurationManager->GetToken(), $token);
|
return hash_equals($this->configurationManager->GetToken(), $token);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,8 @@ class LoginController
|
||||||
}
|
}
|
||||||
|
|
||||||
public function TryLogin(Request $request, Response $response, $args) : Response {
|
public function TryLogin(Request $request, Response $response, $args) : Response {
|
||||||
$userName = $request->getParsedBody()['username'];
|
|
||||||
$password = $request->getParsedBody()['password'];
|
$password = $request->getParsedBody()['password'];
|
||||||
if($this->authManager->CheckCredentials($userName, $password)) {
|
if($this->authManager->CheckCredentials($password)) {
|
||||||
$this->authManager->SetAuthState(true);
|
$this->authManager->SetAuthState(true);
|
||||||
return $response->withHeader('Location', '/')->withStatus(302);
|
return $response->withHeader('Location', '/')->withStatus(302);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,6 @@ class ConfigurationManager
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetUserName() : string {
|
|
||||||
return $this->GetConfig()['username'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function GetPassword() : string {
|
public function GetPassword() : string {
|
||||||
return $this->GetConfig()['password'];
|
return $this->GetConfig()['password'];
|
||||||
}
|
}
|
||||||
|
|
@ -32,7 +28,6 @@ class ConfigurationManager
|
||||||
|
|
||||||
public function SetPassword(string $password) : void {
|
public function SetPassword(string $password) : void {
|
||||||
$config = $this->GetConfig();
|
$config = $this->GetConfig();
|
||||||
$config['username'] = 'admin';
|
|
||||||
$config['password'] = $password;
|
$config['password'] = $password;
|
||||||
$this->WriteConfig($config);
|
$this->WriteConfig($config);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,8 @@
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<img src="/img/logo-blue.svg" style="margin-left: auto;margin-right: auto;display: block;">
|
<img src="/img/logo-blue.svg" style="margin-left: auto;margin-right: auto;display: block;">
|
||||||
<h1>Nextcloud AIO Login</h1>
|
<h1>Nextcloud AIO Login</h1>
|
||||||
<p>Log in using your Nextcloud AIO credentials. If you don't have them you can also use the automatic login from your Nextcloud.</p>
|
<p>Log in using your Nextcloud AIO password. If you don't have it, you can also use the automatic login from your Nextcloud.</p>
|
||||||
<form method="POST" action="/api/auth/login">
|
<form method="POST" action="/api/auth/login">
|
||||||
<input type="text" name="username" placeholder="Username" />
|
|
||||||
<input type="text" name="password" placeholder="Password" />
|
<input type="text" name="password" placeholder="Password" />
|
||||||
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
|
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
|
||||||
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
|
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,9 @@
|
||||||
<div class="login-wrapper">
|
<div class="login-wrapper">
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<img src="/img/logo-blue.svg" style="margin-left: auto;margin-right: auto;display: block;">
|
<img src="/img/logo-blue.svg" style="margin-left: auto;margin-right: auto;display: block;">
|
||||||
<h1>Your credentials for Nextcloud AIO Beta</h1>
|
<h1>Your password for Nextcloud AIO Beta</h1>
|
||||||
<p>Please note down the details to access the management interface and don't loose them!</p>
|
<p>Please note down the password to access the AIO interface and don't loose it!</p>
|
||||||
<p>Nextcloud AIO stands for Nextcloud All In One and provides easy deployment and maintenance with most features included in this one Nextcloud instance.</p>
|
<p>Nextcloud AIO stands for Nextcloud All In One and provides easy deployment and maintenance with most features included in this one Nextcloud instance.</p>
|
||||||
<strong>Username</strong><br/> <span class="monospace">admin</span> <br>
|
|
||||||
<strong>Password</strong><br/> <span class="monospace">{{ password }}</span><br>
|
<strong>Password</strong><br/> <span class="monospace">{{ password }}</span><br>
|
||||||
<a href="/" class="button" target="_blank" rel="noopener">Open Nextcloud AIO login ↗</a>
|
<a href="/" class="button" target="_blank" rel="noopener">Open Nextcloud AIO login ↗</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue