summaryrefslogtreecommitdiff
path: root/app/Auth
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-02-07 23:28:17 -0500
committerFrederic Guillot <fred@kanboard.net>2015-02-07 23:28:17 -0500
commit00b9508d8178bae016b2a25a81282dbe9ae0a9d2 (patch)
tree488397b9830b9ee56ff3eb4752958ea7a44eec04 /app/Auth
parent607d9dc79429cefa51dfe1739564922cc9a2ab89 (diff)
Be able to disable the login form for specific users
Diffstat (limited to 'app/Auth')
-rw-r--r--app/Auth/Database.php9
-rw-r--r--app/Auth/ReverseProxy.php1
2 files changed, 8 insertions, 2 deletions
diff --git a/app/Auth/Database.php b/app/Auth/Database.php
index 2804b9a8..e69f18a9 100644
--- a/app/Auth/Database.php
+++ b/app/Auth/Database.php
@@ -30,9 +30,14 @@ class Database extends Base
*/
public function authenticate($username, $password)
{
- $user = $this->db->table(User::TABLE)->eq('username', $username)->eq('is_ldap_user', 0)->findOne();
+ $user = $this->db
+ ->table(User::TABLE)
+ ->eq('username', $username)
+ ->eq('disable_login_form', 0)
+ ->eq('is_ldap_user', 0)
+ ->findOne();
- if ($user && password_verify($password, $user['password'])) {
+ if (is_array($user) && password_verify($password, $user['password'])) {
$this->userSession->refresh($user);
$this->container['dispatcher']->dispatch('auth.success', new AuthEvent(self::AUTH_NAME, $user['id']));
return true;
diff --git a/app/Auth/ReverseProxy.php b/app/Auth/ReverseProxy.php
index b84550cf..6cd01b28 100644
--- a/app/Auth/ReverseProxy.php
+++ b/app/Auth/ReverseProxy.php
@@ -66,6 +66,7 @@ class ReverseProxy extends Base
'username' => $login,
'is_admin' => REVERSE_PROXY_DEFAULT_ADMIN === $login,
'is_ldap_user' => 1,
+ 'disable_login_form' => 1,
));
}
}