From 65a91baa16dbb71520447264ee667005ad5e09c2 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Fri, 8 Jan 2016 20:39:16 -0500 Subject: [PATCH] Fix inner join bug --- app/Http/Middleware/CheckServer.php | 2 +- app/Models/Server.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Middleware/CheckServer.php b/app/Http/Middleware/CheckServer.php index 808a1e8bf..85da233d5 100644 --- a/app/Http/Middleware/CheckServer.php +++ b/app/Http/Middleware/CheckServer.php @@ -25,7 +25,7 @@ class CheckServer $server = Server::getByUUID($request->route()->server); if (!$server) { - return redirect()->route('index'); + return response()->view('errors.403', [], 403); } if ($server->installed !== 1) { diff --git a/app/Models/Server.php b/app/Models/Server.php index 1075f1b86..190e989e0 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -113,7 +113,7 @@ class Server extends Model } $query = self::select('servers.*', 'services.file as a_serviceFile') - ->join('services', 'services.id', '=', 'servers.id') + ->join('services', 'services.id', '=', 'servers.service') ->where('uuidShort', $uuid)->where('active', 1); if (self::$user->root_admin !== 1) {