summaryrefslogtreecommitdiff
path: root/app/Auth/Database.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-12-27 21:11:11 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-12-27 21:11:11 -0500
commit88d84073aecbe8bdc5f10825b6d7ca6b81c5f7b1 (patch)
treee823c8e13e9ffba115c8e1f5a05a514cac5322df /app/Auth/Database.php
parent0a14c8d5e5538e487dd6b012771f72aea6f4d5a6 (diff)
Add more subscribers
Diffstat (limited to 'app/Auth/Database.php')
-rw-r--r--app/Auth/Database.php14
1 files changed, 2 insertions, 12 deletions
diff --git a/app/Auth/Database.php b/app/Auth/Database.php
index 47dc8e6e..bdb2aeb6 100644
--- a/app/Auth/Database.php
+++ b/app/Auth/Database.php
@@ -3,7 +3,7 @@
namespace Auth;
use Model\User;
-use Core\Request;
+use Event\AuthEvent;
/**
* Database authentication
@@ -33,18 +33,8 @@ class Database extends Base
$user = $this->db->table(User::TABLE)->eq('username', $username)->eq('is_ldap_user', 0)->findOne();
if ($user && password_verify($password, $user['password'])) {
-
- // Update user session
$this->user->updateSession($user);
-
- // Update login history
- $this->lastLogin->create(
- self::AUTH_NAME,
- $user['id'],
- Request::getIpAddress(),
- Request::getUserAgent()
- );
-
+ $this->container['dispatcher']->dispatch('auth.success', new AuthEvent(self::AUTH_NAME, $user['id']));
return true;
}