From 9eeded33f68872515954a2fc177fcb47a9273ae9 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 15 Aug 2014 17:23:41 -0700 Subject: Add email notifications --- app/Model/User.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'app/Model/User.php') diff --git a/app/Model/User.php b/app/Model/User.php index b5744c44..d0e33fd0 100644 --- a/app/Model/User.php +++ b/app/Model/User.php @@ -340,8 +340,7 @@ class User extends Base $this->updateSession($user); // Update login history - $lastLogin = new LastLogin($this->db, $this->event); - $lastLogin->create( + $this->lastLogin->create( $method, $user['id'], $this->getIpAddress(), @@ -350,9 +349,8 @@ class User extends Base // Setup the remember me feature if (! empty($values['remember_me'])) { - $rememberMe = new RememberMe($this->db, $this->event); - $credentials = $rememberMe->create($user['id'], $this->getIpAddress(), $this->getUserAgent()); - $rememberMe->writeCookie($credentials['token'], $credentials['sequence'], $credentials['expiration']); + $credentials = $this->rememberMe->create($user['id'], $this->getIpAddress(), $this->getUserAgent()); + $this->rememberMe->writeCookie($credentials['token'], $credentials['sequence'], $credentials['expiration']); } } else { @@ -384,8 +382,7 @@ class User extends Base // LDAP authentication if (! $authenticated && LDAP_AUTH) { - $ldap = new Ldap($this->db, $this->event); - $authenticated = $ldap->authenticate($username, $password); + $authenticated = $this->ldap->authenticate($username, $password); $method = LastLogin::AUTH_LDAP; } -- cgit v1.2.3