PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 2.10.01
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v2.10.01
2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 1.1.0 All 77 releases
← All changes | Modules/Migrations/Http/Controllers/BPMigrationController.php +19 -2 2.6.012.10.01 View file →
@@ -45,10 +45,27 @@
45 45 }
46 46
47 47 public function startMigration(Request $request)
48 48 {
49 + // Validate the destructive request before mutating anything, so a rejected request
50 + // never clears saved migration progress.
51 + if ($request->get('delete_current_data') === 'yes') {
52 + if (!Helper::isSuperAdmin()) {
53 + return $this->sendError([
54 + 'message' => __('You do not have permission to delete existing FluentCommunity data.', 'fluent-community')
55 + ], 403);
56 + }
57 +
58 + if ($request->get('delete_current_data_confirmation') !== 'DELETE') {
59 + return $this->sendError([
60 + // translators: %s is the confirmation word the user must type (DELETE)
61 + 'message' => sprintf(__('Please type %s to confirm permanently removing all existing FluentCommunity data.', 'fluent-community'), 'DELETE')
62 + ]);
63 + }
64 + }
65 +
49 66 if ($request->get('reset_migration') === 'yes') {
50 - update_option('_fcom_bp_migrations_status', [], 'no');
67 + update_option('_fcom_bp_migrations_status', [], false);
51 68 }
52 69
53 70 if ($request->get('delete_current_data') === 'yes') {
54 71 $this->deleteCurrentData();
@@ -329,9 +346,9 @@
329 346 'last_migrated_user_id',
330 347 'current_stage'
331 348 ]);
332 349
333 - update_option('_fcom_bp_migrations_status', $newData, 'no');
350 + update_option('_fcom_bp_migrations_status', $newData, false);
334 351
335 352 return $newData;
336 353 }
337 354