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')}}
- -