From 9796c09eaa7e3aa7e0f44b4b2c66de95b993ab03 Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Fri, 15 Dec 2023 00:30:57 +0100 Subject: [PATCH] Fixed Advanced Config reset --- app/Http/Controllers/AdminController.php | 8 +-- .../config/advanced-config.blade.php | 51 +++++++++---------- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 8549b84..ef6f839 100755 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -422,9 +422,11 @@ public function SendTestMail(Request $request) //Saves advanced config public function editAC(request $request) { - $AdvancedConfig = $request->AdvancedConfig; - - file_put_contents('config/advanced-config.php', $AdvancedConfig); + if ($request->ResetAdvancedConfig == 'RESET_DEFAULTS') { + copy(base_path('storage/templates/advanced-config.php'), base_path('config/advanced-config.php')); + } else { + file_put_contents('config/advanced-config.php', $request->AdvancedConfig); + } return redirect('/admin/config#2'); } diff --git a/resources/views/components/config/advanced-config.blade.php b/resources/views/components/config/advanced-config.blade.php index 57524dc..644c245 100644 --- a/resources/views/components/config/advanced-config.blade.php +++ b/resources/views/components/config/advanced-config.blade.php @@ -1,40 +1,35 @@

{{__('messages.AC.description')}}

-
+ @csrf
{{ file_get_contents('config/advanced-config.php') }}
- - {{__('messages.Restore defaults')}} - + + {{__('messages.Restore defaults')}}
- -