1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 07:24:27 +02:00

Track user "last seen" time and display whether they are online or not

according to their preferences
This commit is contained in:
Toby Zerner
2015-03-28 11:51:25 +10:30
parent 359f44552e
commit 38ebb15334
5 changed files with 27 additions and 3 deletions

View File

@@ -21,7 +21,10 @@ class LoginWithHeader
if (starts_with($header, $this->prefix) &&
($token = substr($header, strlen($this->prefix))) &&
($accessToken = AccessToken::where('id', $token)->first())) {
$this->actor->setUser($accessToken->user);
$this->actor->setUser($user = $accessToken->user);
$user->last_seen_time = time();
$user->save();
}
return $next($request);