This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/app/Middleware/UpdateLastOnline.php

28 lines
546 B
PHP
Raw Permalink Normal View History

2016-07-30 13:48:09 +00:00
<?php
/**
* Holds the last online update middleware.
* @package Sakura
*/
namespace Sakura\Middleware;
2016-08-07 14:10:27 +00:00
use Sakura\CurrentSession;
2016-07-30 13:48:09 +00:00
/**
* Updates when the last online time of a user.
* @package Sakura
* @author Julian van de Groep <me@flash.moe>
*/
2016-08-05 10:49:46 +00:00
class UpdateLastOnline implements MiddlewareInterface
2016-07-30 13:48:09 +00:00
{
2016-08-05 02:35:37 +00:00
/**
* Update the last online information for the active user.
*/
2016-12-04 16:33:52 +00:00
public function run(): void
2016-07-30 13:48:09 +00:00
{
2016-08-07 14:10:27 +00:00
if (CurrentSession::$user->id !== 0) {
CurrentSession::$user->updateOnline();
2016-07-30 13:48:09 +00:00
}
}
}