⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.162
Server IP:
147.93.29.146
Server:
Linux server.tagooz.co 5.14.0-503.15.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 28 07:25:19 EST 2024 x86_64
Server Software:
Apache
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
webstoremaker
/
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); } }