ajax.php
3 years ago
cleared_cache_ajax.php
3 years ago
create_campaign_ajax.php
3 years ago
delete_data_ajax.php
3 years ago
export_campaigns_ajax.php
3 years ago
export_geo_ajax.php
3 years ago
export_referrers_ajax.php
3 years ago
export_views_ajax.php
3 years ago
filters_ajax.php
3 years ago
migration_status_ajax.php
3 years ago
real_time_ajax.php
3 years ago
test_email_ajax.php
3 years ago
update_capabilities_ajax.php
3 years ago
delete_data_ajax.php
28 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP; |
| 4 | |
| 5 | class Delete_Data_AJAX extends AJAX |
| 6 | { |
| 7 | protected function action_name(): string |
| 8 | { |
| 9 | return 'iawp_delete_data'; |
| 10 | } |
| 11 | |
| 12 | protected function action_callback(): void |
| 13 | { |
| 14 | if (!Capability_Manager::can_edit()) { |
| 15 | return; |
| 16 | } |
| 17 | |
| 18 | $confirmation = $this->get_field('confirmation'); |
| 19 | $valid = strtolower($confirmation) == 'delete all data'; |
| 20 | |
| 21 | if (!$valid) { |
| 22 | return; |
| 23 | } |
| 24 | |
| 25 | new Reset_Database(); |
| 26 | } |
| 27 | } |
| 28 |