summaryrefslogtreecommitdiff
path: root/modules/user/helpers/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user/helpers/user.php')
-rw-r--r--modules/user/helpers/user.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php
index aec058d6..aaf16299 100644
--- a/modules/user/helpers/user.php
+++ b/modules/user/helpers/user.php
@@ -70,6 +70,18 @@ class user {
}
/**
+ * Perform the post authentication processing
+ * @param object $user the user object.
+ */
+ public static function login($user) {
+ $user->login_count += 1;
+ $user->last_login = time();
+ $user->save();
+
+ Session::instance()->set('user', $user);
+ }
+
+ /**
* Create a hashed password using md5 plus salt.
* @param string $password plaintext password
* @param string $salt (optional) salt or hash containing salt (randomly generated if omitted)