From 87e067d49ce97f4fd2403eb449939e467125446b Mon Sep 17 00:00:00 2001 From: BitSec Date: Thu, 30 Sep 2021 05:01:29 +0200 Subject: [PATCH 1/7] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index acea121c..0ee0d65c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Arno VIsker +Copyright (c) 2021 ControlPanel.gg Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 211319ea98a1af6b3669fe3f86b0b88096239a5a Mon Sep 17 00:00:00 2001 From: Dennis Date: Thu, 14 Oct 2021 09:01:35 +0200 Subject: [PATCH 2/7] HotFix to change Hard-Coded Server-limit-after-irl-purchase This is absolutely not tested. --- app/Http/Controllers/Admin/PaymentController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Admin/PaymentController.php b/app/Http/Controllers/Admin/PaymentController.php index 110d2c0d..5b8e3725 100644 --- a/app/Http/Controllers/Admin/PaymentController.php +++ b/app/Http/Controllers/Admin/PaymentController.php @@ -141,9 +141,9 @@ class PaymentController extends Controller $user->increment('credits', $paypalProduct->quantity); //update server limit - if (Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE', 10) !== 0) { - if ($user->server_limit < Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE', 10)) { - $user->update(['server_limit' => 10]); + if (Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) { + if ($user->server_limit < Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')) { + $user->update(['server_limit' => Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')]); } } From b3d73e37862d49aa62391038f23b2726578ba320 Mon Sep 17 00:00:00 2001 From: Dennis Date: Thu, 14 Oct 2021 09:05:59 +0200 Subject: [PATCH 3/7] Reverse Changes. Wrong Commit --- app/Http/Controllers/Admin/PaymentController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Admin/PaymentController.php b/app/Http/Controllers/Admin/PaymentController.php index 5b8e3725..110d2c0d 100644 --- a/app/Http/Controllers/Admin/PaymentController.php +++ b/app/Http/Controllers/Admin/PaymentController.php @@ -141,9 +141,9 @@ class PaymentController extends Controller $user->increment('credits', $paypalProduct->quantity); //update server limit - if (Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) { - if ($user->server_limit < Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')) { - $user->update(['server_limit' => Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')]); + if (Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE', 10) !== 0) { + if ($user->server_limit < Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE', 10)) { + $user->update(['server_limit' => 10]); } } From 251614c507cfe39a8fbaf29b70056d62612b694f Mon Sep 17 00:00:00 2001 From: AVMG20 Date: Fri, 12 Nov 2021 23:16:59 +0100 Subject: [PATCH 4/7] hotfix, create page node not properly updating with multiple locations --- resources/views/servers/create.blade.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/views/servers/create.blade.php b/resources/views/servers/create.blade.php index 1ec98b90..d36e297a 100644 --- a/resources/views/servers/create.blade.php +++ b/resources/views/servers/create.blade.php @@ -411,8 +411,11 @@ this.selectedNestObject = this.nests.find(nest => nest.id == this.selectedNest) ?? {} this.selectedEggObject = this.eggs.find(egg => egg.id == this.selectedEgg) ?? {} + this.selectedNodeObject = {}; this.locations.forEach(location => { - this.selectedNodeObject = location.nodes.find(node => node.id == this.selectedNode) ?? {}; + if (!this.selectedNodeObject?.id) { + this.selectedNodeObject = location.nodes.find(node => node.id == this.selectedNode) ?? {}; + } }) this.selectedProductObject = this.products.find(product => product.id == this.selectedProduct) ?? {} From fe6da0ee155ed321d1652196c5a7f67a3f5eee52 Mon Sep 17 00:00:00 2001 From: AVMG20 Date: Sat, 13 Nov 2021 11:56:34 +0100 Subject: [PATCH 5/7] increased the limit of most api request to pterodacttyl --- app/Classes/Pterodactyl.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/Classes/Pterodactyl.php b/app/Classes/Pterodactyl.php index 1904ed8f..710fbb12 100644 --- a/app/Classes/Pterodactyl.php +++ b/app/Classes/Pterodactyl.php @@ -14,6 +14,11 @@ use Illuminate\Support\Facades\Http; class Pterodactyl { + /** + * @description per_page option to pull more than the default 50 from pterodactyl + */ + public CONST PER_PAGE = 200; + //TODO: Extend error handling (maybe logger for more errors when debugging) /** @@ -43,7 +48,7 @@ class Pterodactyl */ public static function getEggs(Nest $nest) { - $response = self::client()->get("/application/nests/{$nest->id}/eggs?include=nest,variables"); + $response = self::client()->get("/application/nests/{$nest->id}/eggs?include=nest,variables&per_page=" . self::PER_PAGE); if ($response->failed()) throw self::getException(); return $response->json()['data']; } @@ -54,7 +59,7 @@ class Pterodactyl */ public static function getNodes() { - $response = self::client()->get('/application/nodes'); + $response = self::client()->get('/application/nodes?per_page=' . self::PER_PAGE); if ($response->failed()) throw self::getException(); return $response->json()['data']; } @@ -65,7 +70,7 @@ class Pterodactyl */ public static function getNests() { - $response = self::client()->get('/application/nests'); + $response = self::client()->get('/application/nests?per_page=' . self::PER_PAGE); if ($response->failed()) throw self::getException(); return $response->json()['data']; } @@ -76,7 +81,7 @@ class Pterodactyl */ public static function getLocations() { - $response = self::client()->get('/application/locations'); + $response = self::client()->get('/application/locations?per_page=' . self::PER_PAGE); if ($response->failed()) throw self::getException(); return $response->json()['data']; } From 836784be486bc0eb067eb068bdbdf4c5c50245bf Mon Sep 17 00:00:00 2001 From: AVMG20 Date: Thu, 18 Nov 2021 19:22:09 +0100 Subject: [PATCH 6/7] Re-sync bug --- .../Controllers/Auth/SocialiteController.php | 8 ++-- resources/views/profile/index.blade.php | 44 +++++++++++-------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/app/Http/Controllers/Auth/SocialiteController.php b/app/Http/Controllers/Auth/SocialiteController.php index c70a21c5..aa8b93c2 100644 --- a/app/Http/Controllers/Auth/SocialiteController.php +++ b/app/Http/Controllers/Auth/SocialiteController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Auth; use App\Http\Controllers\Controller; use App\Models\Configuration; use App\Models\DiscordUser; +use App\Models\User; use App\Models\Voucher; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Http; @@ -27,14 +28,15 @@ class SocialiteController extends Controller return abort(500); } + /** @var User $user */ + $user = Auth::user(); $discord = Socialite::driver('discord')->user(); - $discordUser = DiscordUser::find($discord->id); $botToken = env('DISCORD_BOT_TOKEN'); $guildId = env('DISCORD_GUILD_ID'); $roleId = env('DISCORD_ROLE_ID'); //save / update discord_users - if (is_null($discordUser)) { + if (is_null($user->discordUser)) { //create discord user in db DiscordUser::create(array_merge($discord->user, ['user_id' => Auth::user()->id])); //update user @@ -42,7 +44,7 @@ class SocialiteController extends Controller Auth::user()->increment('server_limit', Configuration::getValueByKey('SERVER_LIMIT_REWARD_AFTER_VERIFY_DISCORD')); Auth::user()->update(['discord_verified_at' => now()]); } else { - $discordUser->update($discord->user); + $user->discordUser->update($discord->user); } //force user into discord server diff --git a/resources/views/profile/index.blade.php b/resources/views/profile/index.blade.php index 75f2d1a0..4423691e 100644 --- a/resources/views/profile/index.blade.php +++ b/resources/views/profile/index.blade.php @@ -78,9 +78,12 @@ class="pt-sm-2 pb-1 mb-0 text-nowrap">{{$user->name}}

{{$user->email}} @if($user->hasVerifiedEmail()) - + @else - + @endif

@@ -189,8 +192,8 @@ @if(!empty(env('DISCORD_CLIENT_ID')) && !empty(env('DISCORD_CLIENT_SECRET')))
- Link your discord account! @if(is_null(Auth::user()->discordUser)) + Link your discord account!
@if($credits_reward_after_verify_discord) @@ -198,7 +201,8 @@ extra {{$credits_reward_after_verify_discord}} - {{CREDITS_DISPLAY_NAME}} and increased server limit + {{CREDITS_DISPLAY_NAME}} and increased server + limit

@endif
@@ -213,21 +217,25 @@

You are verified!

-
-
-
-
-

{{$user->discordUser->username}} {{$user->discordUser->locale}}

-

{{$user->discordUser->id}} -

-
-
avatar
-
-