mirror of
https://github.com/friendica/friendica
synced 2025-04-25 18:30:11 +00:00
New field to show the day of the last activity
This commit is contained in:
parent
fbcc56d42d
commit
f905220923
8 changed files with 50 additions and 4 deletions
|
@ -665,6 +665,22 @@ class User
|
|||
return $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the day of the last activity of the given user
|
||||
*
|
||||
* @param integer $uid
|
||||
* @return void
|
||||
*/
|
||||
public static function updateLastActivity(int $uid)
|
||||
{
|
||||
$user = User::getById($uid, ['last-activity']);
|
||||
$current_day = date('Y-m-d');
|
||||
|
||||
if ($user['last-activity'] != $current_day) {
|
||||
User::update(['last-activity' => $current_day], $uid);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a human-readable random password
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue