diff --git a/application/config/config.php b/application/config/config.php index dbac9753..1b7e624d 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -389,7 +389,9 @@ $config['csrf_cookie_name'] = 'csrf_cookie'; $config['csrf_expire'] = 7200; $config['csrf_exclude_uris'] = [ 'api/v1/.*', - 'booking/.*' + 'booking/.*', + 'booking_cancellation/.*', + 'booking_confirmation/.*' ]; /* diff --git a/application/controllers/Booking_cancellation.php b/application/controllers/Booking_cancellation.php index 7b8c987d..f5019948 100755 --- a/application/controllers/Booking_cancellation.php +++ b/application/controllers/Booking_cancellation.php @@ -55,13 +55,22 @@ class Booking_cancellation extends EA_Controller { abort(403, 'Forbidden'); } - $exceptions = []; - $occurrences = $this->appointments_model->get(['hash' => $appointment_hash]); if (empty($occurrences)) { - throw new Exception('No record matches the provided hash.'); + html_vars([ + 'page_title' => lang('appointment_not_found'), + 'message_title' => lang('appointment_not_found'), + 'message_text' => lang('appointment_does_not_exist_in_db'), + 'message_icon' => base_url('assets/img/error.png'), + 'google_analytics_code' => setting('google_analytics_code'), + 'matomo_analytics_url' => setting('matomo_analytics_url'), + ]); + + $this->load->view('pages/booking_message'); + + return; } $appointment = $occurrences[0]; @@ -88,18 +97,13 @@ class Booking_cancellation extends EA_Controller { } catch (Throwable $e) { - $exceptions[] = $e; + log_message('error', 'Booking Cancellation Exception: ' . $e->getMessage()); } html_vars([ - 'message_title' => lang('appointment_cancelled_title'), - 'message_text' => lang('appointment_cancelled'), - 'message_icon' => base_url('assets/img/success.png'), - 'google_analytics_code' => setting('google_analytics_code'), - 'matomo_analytics_url' => setting('matomo_analytics_url'), - 'exceptions' => $exceptions + 'page_title' => lang('appointment_cancelled_title'), ]); - $this->load->view('pages/booking_message'); + $this->load->view('pages/booking_cancellation'); } } diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index 9c41e48e..26ea0e94 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -55,7 +55,7 @@ $lang['appointment_added_to_your_plan'] = 'A new appointment has been added to y $lang['appointment_link_description'] = 'You can make changes by clicking the appointment link below.'; $lang['appointment_locked'] = 'Modification impossible!'; $lang['appointment_locked_message'] = 'The appointment cannot be changed less than {$limit} hours in advance.'; -$lang['appointment_not_found'] = 'Appointment Not Found.'; +$lang['appointment_not_found'] = 'Appointment Not Found'; $lang['appointment_does_not_exist_in_db'] = 'The appointment you requested does not exist in the system database anymore.'; $lang['display_calendar'] = 'Display Calendar'; $lang['calendar'] = 'Calendar'; diff --git a/application/views/components/booking_cancellation_frame.php b/application/views/components/booking_cancellation_frame.php index 71a31f43..c7f8aa8b 100644 --- a/application/views/components/booking_cancellation_frame.php +++ b/application/views/components/booking_cancellation_frame.php @@ -17,9 +17,7 @@