Skip to content

Commit

Permalink
setting check fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinecraft committed Nov 14, 2024
1 parent 6f197cd commit e2c7f39
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/Http/Controllers/Api/ApiBanWardenController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Illuminate\Support\Arr;
use Cache;

class ApiBanWardenController extends ApiController
Expand Down Expand Up @@ -45,7 +46,8 @@ public function postSyncPunishments(Request $request, GeolocationService $geoloc

$banwardenEnabledInConfig = config('minetrax.banwarden.enabled');
$server = Server::where('id', $request->input('data.server_id'))->firstOrFail();
if (!$banwardenEnabledInConfig || !$server->settings['is_banwarden_enabled']) {
$banwardenEnabledForServer = Arr::get($server->settings, 'is_banwarden_enabled', false);
if (!$banwardenEnabledInConfig || !$banwardenEnabledForServer) {
return $this->error(__('BanWarden is disabled globally or on this server.'), 'banwarden_disabled', 403);
}

Expand Down Expand Up @@ -156,7 +158,8 @@ public function postReportPunishment(Request $request, GeolocationService $geolo

$banwardenEnabledInConfig = config('minetrax.banwarden.enabled');
$server = Server::where('id', $request->input('data.server_id'))->firstOrFail();
if (!$banwardenEnabledInConfig || !$server->settings['is_banwarden_enabled']) {
$banwardenEnabledForServer = Arr::get($server->settings, 'is_banwarden_enabled', false);
if (!$banwardenEnabledInConfig || !$banwardenEnabledForServer) {
return $this->error(__('BanWarden is disabled globally or on this server.'), 'banwarden_disabled', 403);
}

Expand Down

0 comments on commit e2c7f39

Please sign in to comment.