Skip to content

Commit 65a91ba

Browse files
committed
Fix inner join bug
1 parent 022143d commit 65a91ba

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/Http/Middleware/CheckServer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function handle($request, Closure $next)
2525

2626
$server = Server::getByUUID($request->route()->server);
2727
if (!$server) {
28-
return redirect()->route('index');
28+
return response()->view('errors.403', [], 403);
2929
}
3030

3131
if ($server->installed !== 1) {

app/Models/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public static function getByUUID($uuid)
113113
}
114114

115115
$query = self::select('servers.*', 'services.file as a_serviceFile')
116-
->join('services', 'services.id', '=', 'servers.id')
116+
->join('services', 'services.id', '=', 'servers.service')
117117
->where('uuidShort', $uuid)->where('active', 1);
118118

119119
if (self::$user->root_admin !== 1) {

0 commit comments

Comments
 (0)