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 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.
|
|
|
|
*/
|
2022-11-29 17:53:59 +00:00
|
|
|
public function handle(Request $request, \Closure $next)
|
2022-05-29 22:48:35 +00:00
|
|
|
{
|
|
|
|
LogTarget::setActor($request->user());
|
|
|
|
LogTarget::setSubject($request->user());
|
|
|
|
|
|
|
|
return $next($request);
|
|
|
|
}
|
|
|
|
}
|