← All changes
|
app/Services/Integrations/Elementor/ElementorIntegration.php
+11
-2
2.1.1
→
2.5.0
View file →
| @@ -99,16 +99,20 @@ | ||
| 99 | 99 | wp_send_json_error(['message' => __('Nonce verification failed', 'fluent-booking')]); |
| 100 | 100 | exit; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | + if (!current_user_can('edit_posts')) { | |
| 104 | + wp_send_json_error(['message' => __('You do not have permission to perform this action', 'fluent-booking')]); | |
| 105 | + exit; | |
| 106 | + } | |
| 107 | + | |
| 103 | 108 | if (!isset($_POST['cal_id'])) { |
| 104 | 109 | wp_send_json_error(['message' => __('No calendar ID provided', 'fluent-booking')]); |
| 105 | 110 | } |
| 106 | 111 | |
| 107 | 112 | $calId = intval($_POST['cal_id']); |
| 108 | - $events = []; // Fetch events using your getCalendarEvents method or similar | |
| 113 | + $events = []; | |
| 109 | 114 | |
| 110 | - // Example of fetching events (you need to replace this with your actual method) | |
| 111 | 115 | $events = $this->getCalendarEvents($calId); |
| 112 | 116 | |
| 113 | 117 | wp_send_json_success($events); |
| 114 | 118 | } |
| @@ -115,8 +119,13 @@ | ||
| 115 | 119 | |
| 116 | 120 | public function ajaxGetEventHash() { |
| 117 | 121 | if (!isset($_POST['security']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['security'])), 'calendar_events_nonce')) { |
| 118 | 122 | wp_send_json_error(['message' => __('Nonce verification failed', 'fluent-booking')]); |
| 123 | + exit; | |
| 124 | + } | |
| 125 | + | |
| 126 | + if (!current_user_can('edit_posts')) { | |
| 127 | + wp_send_json_error(['message' => __('You do not have permission to perform this action', 'fluent-booking')]); | |
| 119 | 128 | exit; |
| 120 | 129 | } |
| 121 | 130 | |
| 122 | 131 | $eventId = isset($_POST['event_id']) ? intval($_POST['event_id']) : null; |