diff --git a/app/Console/Commands/DisableRecaptcha.php b/app/Console/Commands/DisableRecaptcha.php new file mode 100644 index 000000000..fa42b5868 --- /dev/null +++ b/app/Console/Commands/DisableRecaptcha.php @@ -0,0 +1,54 @@ +settings = $settings; + } + public function handle() + { + try{ + + $this->settings->recaptcha_enabled = !$this->settings->recaptcha_enabled; + $this->settings->save(); + $this->info('Recaptcha enabled: ' . ($this->settings->recaptcha_enabled ? 'true' : 'false')); + + } catch (Exception $e) { + $this->error('An error occurred: ' . $e->getMessage()); + Log::error($e); + } + return Command::SUCCESS; + } +} diff --git a/app/Http/Controllers/TicketsController.php b/app/Http/Controllers/TicketsController.php index 447e0cc8d..36734930a 100644 --- a/app/Http/Controllers/TicketsController.php +++ b/app/Http/Controllers/TicketsController.php @@ -28,6 +28,7 @@ class TicketsController extends Controller const WRITE_PERMISSION = 'user.ticket.write'; public function index(LocaleSettings $locale_settings, TicketSettings $ticketSettings) { + $this->checkAnyPermission([self::READ_PERMISSION, self::WRITE_PERMISSION]); return view('ticket.index', [ 'ticketsettings' => $ticketSettings, 'tickets' => Ticket::where('user_id', Auth::user()->id)->paginate(10), @@ -39,6 +40,8 @@ public function index(LocaleSettings $locale_settings, TicketSettings $ticketSet public function store(Request $request, GeneralSettings $generalSettings) { + $this->checkPermission(self::WRITE_PERMISSION); + if (RateLimiter::tooManyAttempts('ticket-send:'.Auth::user()->id, $perMinute = 1)) { return redirect()->back()->with('error', __('Please wait before creating a new Ticket')); } @@ -88,6 +91,7 @@ public function show($ticket_id, PterodactylSettings $ptero_settings) $this->checkPermission(self::READ_PERMISSION); try { $ticket = Ticket::where('ticket_id', $ticket_id)->firstOrFail(); + if($ticket->user_id != Auth::user()->id){ return redirect()->back()->with('error', __('This ticket is not made by you or dosent exist')); } } catch (Exception $e) { return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier')); } @@ -101,6 +105,8 @@ public function show($ticket_id, PterodactylSettings $ptero_settings) public function reply(Request $request) { + $this->checkPermission(self::WRITE_PERMISSION); + if (RateLimiter::tooManyAttempts('ticket-reply:'.Auth::user()->id, $perMinute = 1)) { return redirect()->back()->with('error', __('Please wait before answering a Ticket')); } @@ -112,6 +118,7 @@ public function reply(Request $request) $this->validate($request, ['ticketcomment' => 'required']); try { $ticket = Ticket::where('id', $request->input('ticket_id'))->firstOrFail(); + if($ticket->user_id != Auth::user()->id){ return redirect()->back()->with('error', __('This ticket is not made by you or dosent exist')); } } catch (Exception $e) { return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier')); } @@ -151,8 +158,12 @@ public function create() public function changeStatus($ticket_id) { + $this->checkPermission(self::WRITE_PERMISSION); + + try { $ticket = Ticket::where('user_id', Auth::user()->id)->where("ticket_id", $ticket_id)->firstOrFail(); + if($ticket->user_id != Auth::user()->id){ return redirect()->back()->with('warning', __('This ticket is not made by you or dosent exist')); } } catch (Exception $e) { return redirect()->back()->with('warning', __('Ticket not found on the server. It potentially got deleted earlier')); } diff --git a/config/app.php b/config/app.php index 7c7b09a3d..feaeda7c4 100644 --- a/config/app.php +++ b/config/app.php @@ -4,7 +4,7 @@ return [ - 'version' => '1.0.0', + 'version' => '1.0.2', /* |-------------------------------------------------------------------------- diff --git a/docker/standalone/Dockerfile b/docker/standalone/Dockerfile index a16bed8cb..bf9af7e19 100644 --- a/docker/standalone/Dockerfile +++ b/docker/standalone/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-fpm +FROM php:8.3-fpm # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ diff --git a/public/installer/index.php b/public/installer/index.php index 600a3297e..415b57f55 100644 --- a/public/installer/index.php +++ b/public/installer/index.php @@ -44,12 +44,12 @@ 2 => ['view' => 'timezone-configuration', 'is_revertable' => true], 3 => ['view' => 'database-configuration', 'is_revertable' => true], 4 => ['view' => 'database-migration', 'is_revertable' => false], - 5 => ['view' => 'redis-configuration', 'is_revertable' => true], - 6 => ['view' => 'dashboard-configuration', 'is_revertable' => true], - 7 => ['view' => 'email-configuration', 'is_revertable' => true], - 8 => ['view' => 'pterodactyl-configuration', 'is_revertable' => false], - 9 => ['view' => 'admin-creation', 'is_revertable' => false], - 10 => ['view' => 'installation-complete', 'is_revertable' => false], + // 5 => ['view' => 'redis-configuration', 'is_revertable' => true], + 5 => ['view' => 'dashboard-configuration', 'is_revertable' => true], + 6 => ['view' => 'email-configuration', 'is_revertable' => true], + 7 => ['view' => 'pterodactyl-configuration', 'is_revertable' => false], + 8 => ['view' => 'admin-creation', 'is_revertable' => false], + 9 => ['view' => 'installation-complete', 'is_revertable' => false], ]; $_SESSION['last_installation_step'] = count($stepConfig); @@ -100,4 +100,4 @@ // setting / reseting the error message $_SESSION['error-message'] = null; -?> \ No newline at end of file +?> diff --git a/public/installer/src/functions/environment.php b/public/installer/src/functions/environment.php index 456680673..588d99353 100644 --- a/public/installer/src/functions/environment.php +++ b/public/installer/src/functions/environment.php @@ -53,7 +53,7 @@ function checkExtensions(): array $requirements = [ 'minPhp' => '8.2', - 'maxPhp' => '8.4', // This version is not supported + 'maxPhp' => '8.5', // This version is not supported 'mysql' => '5.7.22', ]; diff --git a/public/installer/views/mandatory-checks.php b/public/installer/views/mandatory-checks.php index 24c0aa6a7..84a37d46a 100644 --- a/public/installer/views/mandatory-checks.php +++ b/public/installer/views/mandatory-checks.php @@ -37,7 +37,7 @@


Important: - CtrlPanel.gg requires a MySQL-Database, Redis-Server, and Pterodactyl-Panel to work.
+ CtrlPanel.gg requires a MySQL-Database and Pterodactyl-Panel to work.
Please make sure you have these installed and running before you continue.

diff --git a/public/installer/views/redis-configuration.php b/public/installer/views/redis-configuration.php index 54bc220fc..fba445e1f 100644 --- a/public/installer/views/redis-configuration.php +++ b/public/installer/views/redis-configuration.php @@ -62,6 +62,11 @@ class="px-2 py-1 bg-[#1D2125] border-2 focus:border-sky-500 box-border rounded-m + + + - - + @@ -139,7 +138,7 @@ class="form-control @error('referral_code') is-invalid @enderror" required="requ
+ name="new_password" id="new_password" type="password" placeholder="••••••"> @error('new_password')
@@ -152,7 +151,7 @@ class="form-control @error('new_password') is-invalid @enderror"
@error('new_password_confirmation') @@ -162,7 +161,8 @@ class="form-control @error('new_password_confirmation') is-invalid @enderror" @enderror
- + +
diff --git a/themes/default/views/layouts/main.blade.php b/themes/default/views/layouts/main.blade.php index 509dc11af..1d40c2d9a 100644 --- a/themes/default/views/layouts/main.blade.php +++ b/themes/default/views/layouts/main.blade.php @@ -643,6 +643,22 @@ class="nav-link @if (Request::routeIs('admin.activitylogs.*')) active @endif"> } }) @endif + @if (Session::has('warning')) + Swal.fire({ + icon: 'warning', + title: '{{ Session::get('warning') }}', + position: 'top-end', + showConfirmButton: false, + background: '#343a40', + toast: true, + timer: 3000, + timerProgressBar: true, + didOpen: (toast) => { + toast.addEventListener('mouseenter', Swal.stopTimer) + toast.addEventListener('mouseleave', Swal.resumeTimer) + } + }) + @endif