From 963413eb8849568f5b75589740878cac3d0d03cf Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 1 Mar 2023 08:26:58 +0100 Subject: [PATCH] White list the working plan and working plan exceptions when saving a provider record --- application/controllers/Providers.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/application/controllers/Providers.php b/application/controllers/Providers.php index 2c2bf5b7..e02f356a 100644 --- a/application/controllers/Providers.php +++ b/application/controllers/Providers.php @@ -60,12 +60,12 @@ class Providers extends EA_Controller { } $role_slug = session('role_slug'); - - $services = $this->services_model->get(); - - foreach($services as &$service) + + $services = $this->services_model->get(); + + foreach ($services as &$service) { - $this->services_model->only($service, ['id', 'name']); + $this->services_model->only($service, ['id', 'name']); } script_vars([ @@ -158,6 +158,8 @@ class Providers extends EA_Controller { $this->providers_model->only($provider['settings'], [ 'username', 'password', + 'working_plan', + 'working_plan_exceptions', 'notifications', 'calendar_view' ]); @@ -217,6 +219,15 @@ class Providers extends EA_Controller { 'services', ]); + $this->providers_model->only($provider['settings'], [ + 'username', + 'password', + 'working_plan', + 'working_plan_exceptions', + 'notifications', + 'calendar_view' + ]); + $this->providers_model->optional($provider, [ 'services' => [], ]);