2022-05-29 22:48:35 +00:00
|
|
|
<?php
|
|
|
|
|
2022-06-18 16:07:32 +00:00
|
|
|
namespace Pterodactyl\Http\Middleware\Activity;
|
2022-05-29 22:48:35 +00:00
|
|
|
|
|
|
|
use Closure;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Pterodactyl\Facades\LogTarget;
|
|
|
|
|
2022-06-18 16:07:32 +00:00
|
|
|
class AccountSubject
|
2022-05-29 22:48:35 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Sets the actor and default subject for all requests passing through this
|
|
|
|
* middleware to be the currently logged in user.
|
|
|
|
*/
|
|
|
|
public function handle(Request $request, Closure $next)
|
|
|
|
{
|
|
|
|
LogTarget::setActor($request->user());
|
|
|
|
LogTarget::setSubject($request->user());
|
|
|
|
|
|
|
|
return $next($request);
|
|
|
|
}
|
|
|
|
}
|