aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/users.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-11-20 19:05:00 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-11-20 19:05:00 +0000
commit0f3892d8a732d965c58a4816ee7253ffda517ac3 (patch)
tree2281acf5ab609bfd193b2b89333d78627e391582 /engine/lib/users.php
parent3de118dae7fdc17e117330078846f538254411d0 (diff)
downloadelgg-0f3892d8a732d965c58a4816ee7253ffda517ac3.tar.gz
elgg-0f3892d8a732d965c58a4816ee7253ffda517ac3.tar.bz2
Fixes #548: Introducing set_last_login($user_guid). Called from login(), but call from any authentication code where appropriate.
git-svn-id: https://code.elgg.org/elgg/trunk@2481 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r--engine/lib/users.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index ee47bf078..e920472c9 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -1257,6 +1257,21 @@
}
/**
+ * Sets the last logon time of the given user to right now.
+ *
+ * @param int $user_guid The user GUID
+ */
+ function set_last_login($user_guid) {
+
+ $user_guid = (int) $user_guid;
+ global $CONFIG;
+ $time = time();
+
+ execute_delayed_write_query("UPDATE {$CONFIG->dbprefix}users_entity set prev_last_login = last_login, last_login = {$time} where guid = {$user_guid}");
+
+ }
+
+ /**
* A permissions plugin hook that grants access to users if they are newly created - allows
* for email activation.
*