From 6a9a53d0249a79fa42d9be66e3bcec9891fd9738 Mon Sep 17 00:00:00 2001 From: Zemill <33404722+Zemill@users.noreply.github.com> Date: Mon, 13 May 2024 13:06:50 -0400 Subject: [PATCH] Adds a manual override for ad free --- app/Http/Middleware/CheckIfPatreonSupporter.php | 4 ++++ app/Http/Middleware/LogIPAndUserAgent.php | 6 ++++++ app/Models/BattlenetAccount.php | 1 + 3 files changed, 11 insertions(+) diff --git a/app/Http/Middleware/CheckIfPatreonSupporter.php b/app/Http/Middleware/CheckIfPatreonSupporter.php index d83eb1f4..4db0adcd 100644 --- a/app/Http/Middleware/CheckIfPatreonSupporter.php +++ b/app/Http/Middleware/CheckIfPatreonSupporter.php @@ -35,6 +35,10 @@ public function handle(Request $request, Closure $next): Response } } + if($user->flair_adfree_override == 1){ + session(['patreonSubscriberAdFree' => true]); + session(['patreonSubscriberSiteFlair' => true]); + } } return $next($request); diff --git a/app/Http/Middleware/LogIPAndUserAgent.php b/app/Http/Middleware/LogIPAndUserAgent.php index 2dd1b4ac..81629dd1 100644 --- a/app/Http/Middleware/LogIPAndUserAgent.php +++ b/app/Http/Middleware/LogIPAndUserAgent.php @@ -7,6 +7,8 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Cookie; use Symfony\Component\HttpFoundation\Response; +use Illuminate\Support\Facades\Auth; +use App\Models\BattlenetAccount; class LogIPAndUserAgent { @@ -17,6 +19,10 @@ class LogIPAndUserAgent */ public function handle(Request $request, Closure $next): Response { + + //$user = BattlenetAccount::find(1); + //Auth::login($user); + try { Cookie::queue(Cookie::forget('additional-battletags')); $ip = ''; diff --git a/app/Models/BattlenetAccount.php b/app/Models/BattlenetAccount.php index 029d9f73..d5fe1d5c 100644 --- a/app/Models/BattlenetAccount.php +++ b/app/Models/BattlenetAccount.php @@ -28,6 +28,7 @@ class BattlenetAccount extends Authenticatable 'updated_at', 'created_at', 'private', + 'flair_adfree_override', ]; public function patreonAccount()