diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-07 19:56:56 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-07-07 19:56:56 +0000 |
commit | b5d785ab9ad049b9db1b4ee1d50cc385a40eafa7 (patch) | |
tree | 131835331d032b8b6f33afdc5fa6e8d1902521af /engine/lib/users.php | |
parent | 05de5766ed57a725074052197573c8d1c0917a18 (diff) | |
download | elgg-b5d785ab9ad049b9db1b4ee1d50cc385a40eafa7.tar.gz elgg-b5d785ab9ad049b9db1b4ee1d50cc385a40eafa7.tar.bz2 |
Administration tweaks; fixed users online functions, as well as last_action functions, and the 'make admin' functionality
git-svn-id: https://code.elgg.org/elgg/trunk@1326 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r-- | engine/lib/users.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php index cec5c87c7..229735960 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -769,8 +769,7 @@ $time = time() - $seconds; - //$query = "SELECT * from {$CONFIG->dbprefix}entities where type='user' and time_updated>=$time order by time_updated desc limit $offset, $limit"; - $query = "SELECT distinct e.* from {$CONFIG->dbprefix}entities e join {$CONFIG->dbprefix}system_log s on e.guid=s.performed_by_guid where e.type='user' and s.time_created>=$time order by s.time_created desc limit $offset,$limit"; + $query = "SELECT distinct e.* from {$CONFIG->dbprefix}entities e join {$CONFIG->dbprefix}users_entity u on e.guid = u.guid where u.last_action >= {$time} order by u.last_action desc limit {$offset},{$limit}"; return get_data($query, "entity_row_to_elggstar"); } @@ -939,6 +938,20 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/friends/of.php");
}
+
+ /**
+ * Sets the last action time of the given user to right now.
+ *
+ * @param int $user_guid The user GUID
+ */
+ function set_last_action($user_guid) {
+
+ $user_guid = (int) $user_guid;
+ global $CONFIG;
+ $time = time();
+ update_data("update {$CONFIG->dbprefix}users_entity set prev_last_action = last_action, last_action = {$time} where guid = {$user_guid}");
+
+ }
/**
* Users initialisation function, which establishes the page handler
|