diff --git a/app/Http/Controllers/Moderation/TicketsController.php b/app/Http/Controllers/Moderation/TicketsController.php index 7a9139d2..ac08ba08 100644 --- a/app/Http/Controllers/Moderation/TicketsController.php +++ b/app/Http/Controllers/Moderation/TicketsController.php @@ -117,9 +117,7 @@ class TicketsController extends Controller } public function blacklist() { - $users = User::paginate(); - $ticketcategories = TicketCategory::all(); - return view("moderator.ticket.blacklist", compact("users", "ticketcategories")); + return view("moderator.ticket.blacklist"); } public function blacklistAdd(Request $request) { diff --git a/app/Http/Controllers/ServerController.php b/app/Http/Controllers/ServerController.php index 66e8d6ed..787060a1 100644 --- a/app/Http/Controllers/ServerController.php +++ b/app/Http/Controllers/ServerController.php @@ -227,6 +227,7 @@ class ServerController extends Controller /** Show Server Settings */ public function show(Server $server) { + if($server->user_id != Auth::user()->id) return redirect()->route('servers.index'); $serverAttributes = Pterodactyl::getServerAttributes($server->pterodactyl_id); $serverRelationships = $serverAttributes['relationships']; $serverLocationAttributes = $serverRelationships['location']['attributes']; @@ -254,6 +255,7 @@ class ServerController extends Controller public function upgrade(Server $server, Request $request) { + if($server->user_id != Auth::user()->id) return redirect()->route('servers.index'); if(!isset($request->product_upgrade)) { return redirect()->route('servers.show', ['server' => $server->id])->with('error', __('this product is the only one')); diff --git a/app/Http/Controllers/TicketsController.php b/app/Http/Controllers/TicketsController.php index f764da11..8bb21a66 100644 --- a/app/Http/Controllers/TicketsController.php +++ b/app/Http/Controllers/TicketsController.php @@ -31,7 +31,7 @@ class TicketsController extends Controller public function create() { #check in blacklist $check = TicketBlacklist::where('user_id', Auth::user()->id)->first(); - if($check->status == "True"){ + if($check && $check->status == "True"){ return redirect()->route('ticket.index')->with('error', __("You can't make a ticket because you're on the blacklist for a reason: '" . $check->reason . "', please contact the administrator")); } $ticketcategories = TicketCategory::all(); @@ -73,7 +73,7 @@ class TicketsController extends Controller public function reply(Request $request) { #check in blacklist $check = TicketBlacklist::where('user_id', Auth::user()->id)->first(); - if($check->status == "True"){ + if($check && $check->status == "True"){ return redirect()->route('ticket.index')->with('error', __("You can't reply a ticket because you're on the blacklist for a reason: '" . $check->reason . "', please contact the administrator")); } $this->validate($request, array("ticketcomment" => "required")); diff --git a/resources/views/moderator/ticket/blacklist.blade.php b/resources/views/moderator/ticket/blacklist.blade.php index a1c2c2c1..2a8d8f2a 100644 --- a/resources/views/moderator/ticket/blacklist.blade.php +++ b/resources/views/moderator/ticket/blacklist.blade.php @@ -69,9 +69,6 @@