diff --git a/application/controllers/Booking.php b/application/controllers/Booking.php index 8307c969..2fab9463 100755 --- a/application/controllers/Booking.php +++ b/application/controllers/Booking.php @@ -103,6 +103,7 @@ class Booking extends EA_Controller { $display_privacy_policy = setting('display_privacy_policy'); $privacy_policy_content = setting('privacy_policy_content'); $display_any_provider = setting('display_any_provider'); + $display_delete_personal_information = setting('display_delete_personal_information'); $book_advance_timeout = setting('book_advance_timeout'); $google_analytics_code = setting('google_analytics_code'); $matomo_analytics_url = setting('matomo_analytics_url'); @@ -224,6 +225,7 @@ class Booking extends EA_Controller { 'display_privacy_policy' => $display_privacy_policy, 'privacy_policy_content' => $privacy_policy_content, 'display_any_provider' => $display_any_provider, + 'display_delete_personal_information' => $display_delete_personal_information, 'google_analytics_code' => $google_analytics_code, 'matomo_analytics_url' => $matomo_analytics_url, 'timezones' => $timezones, diff --git a/application/controllers/Privacy.php b/application/controllers/Privacy.php index a81ae536..90f9f7d9 100644 --- a/application/controllers/Privacy.php +++ b/application/controllers/Privacy.php @@ -38,6 +38,13 @@ class Privacy extends EA_Controller { { try { + $display_delete_personal_information = setting('display_delete_personal_information'); + + if ( ! $display_delete_personal_information) + { + abort(403, 'Forbidden'); + } + $customer_token = request('customer_token'); if (empty($customer_token)) diff --git a/application/migrations/029_add_display_delete_personal_information_setting.php b/application/migrations/029_add_display_delete_personal_information_setting.php new file mode 100644 index 00000000..7092c19c --- /dev/null +++ b/application/migrations/029_add_display_delete_personal_information_setting.php @@ -0,0 +1,41 @@ + + * @copyright Copyright (c) Alex Tselegidis + * @license https://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link https://easyappointments.org + * @since v1.4.0 + * ---------------------------------------------------------------------------- */ + +class Migration_Add_display_delete_personal_information_setting extends EA_Migration { + /** + * Upgrade method. + */ + public function up() + { + if ( ! $this->db->get_where('settings', ['name' => 'display_delete_personal_information'])->num_rows()) + { + $this->db->insert('settings', [ + 'name' => 'display_delete_personal_information', + 'value' => '0' + ]); + } + } + + /** + * Downgrade method. + */ + public function down() + { + if ( ! $this->db->get_where('settings', ['name' => 'display_delete_personal_information'])->num_rows()) + { + $this->db->delete('settings', [ + 'name' => 'display_delete_personal_information', + ]); + } + } +} diff --git a/application/views/components/booking_cancellation_frame.php b/application/views/components/booking_cancellation_frame.php index 9d62c8c4..71a31f43 100644 --- a/application/views/components/booking_cancellation_frame.php +++ b/application/views/components/booking_cancellation_frame.php @@ -1,9 +1,10 @@ @@ -27,15 +28,17 @@ -