One Hat Cyber Team
Your IP :
216.73.216.187
Server IP :
178.63.234.5
Server :
Linux whm01.ins-jo.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Server Software :
Apache
PHP Version :
8.1.32
Buat File
|
Buat Folder
Dir :
~
/
home
/
business
/
public_html
/
app
/
Http
/
Middleware
/
Edit 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); } }
Save