From b8e9056ee3fb98439284ed916b782c6d8c9d8f12 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 4 Dec 2021 15:30:08 -0700 Subject: [PATCH] Update UserInviteController, fixes #3017 --- app/Http/Controllers/UserInviteController.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/UserInviteController.php b/app/Http/Controllers/UserInviteController.php index c9f83301f..9a8272820 100644 --- a/app/Http/Controllers/UserInviteController.php +++ b/app/Http/Controllers/UserInviteController.php @@ -9,19 +9,16 @@ use Illuminate\Support\Str; class UserInviteController extends Controller { - public function __construct() - { - abort_if(!config('pixelfed.user_invites.enabled'), 404); - } - public function create(Request $request) { + abort_if(!config('pixelfed.user_invites.enabled'), 404); abort_unless(Auth::check(), 403); return view('settings.invites.create'); } public function show(Request $request) { + abort_if(!config('pixelfed.user_invites.enabled'), 404); abort_unless(Auth::check(), 403); $invites = UserInvite::whereUserId(Auth::id())->paginate(10); $limit = config('pixelfed.user_invites.limit.total'); @@ -31,6 +28,7 @@ class UserInviteController extends Controller public function store(Request $request) { + abort_if(!config('pixelfed.user_invites.enabled'), 404); abort_unless(Auth::check(), 403); $this->validate($request, [ 'email' => 'required|email|unique:users|unique:user_invites',