PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 2.2.0
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v2.2.0
2.2.0 2.1.0 2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 All 43 releases
← All changes | app/Hooks/actions.php +44 -4 2.0.0 → 2.2.0 View file →
@@ -2,8 +2,9 @@
2 2 //if accessed directly exit
3 3 if (!defined('ABSPATH')) exit;
4 4
5 5 use FluentBoards\App\Services\Helper;
6 +use FluentBoards\App\Services\Libs\FileSystem;
6 7
7 8 /**
8 9 * All registered action's handlers should be in app\Hooks\Handlers,
9 10 * addAction is similar to add_action and addCustomAction is just a
@@ -17,9 +18,41 @@
17 18 * @var $app FluentBoards\Framework\Foundation\Application
18 19 */
19 20
20 21 (new \FluentBoards\App\Hooks\Handlers\AdminMenuHandler())->register();
22 +$app->addAction('admin_init', 'UpdateHandler@maybeUpgradeIndexes', 10, 0);
21 23
24 +add_action('fluent_boards/check_upload_protection', function () {
25 + FileSystem::checkUploadProtection();
26 +});
27 +
28 +// Cover existing uploads after updates, even before another file is uploaded.
29 +add_action('admin_init', function () {
30 + if (!current_user_can('manage_options') || wp_doing_ajax()) {
31 + return;
32 + }
33 +
34 + $protectionReady = FileSystem::installUploadProtectionRules(false);
35 + $blocked = FileSystem::checkUploadProtection(false);
36 + if (!$protectionReady || $blocked !== true) {
37 + add_action('admin_notices', function () use ($protectionReady, $blocked) {
38 + if ($blocked === false) {
39 + $message = __('Fluent Boards uploads are accessible by direct URL without a login. Ask your hosting provider to block direct web access to this directory and its subdirectories.', 'fluent-boards');
40 + } elseif (!$protectionReady) {
41 + $message = __('Fluent Boards could not prepare upload-directory protection. Ask your hosting provider to check filesystem permissions and block direct access to uploads.', 'fluent-boards');
42 + } else {
43 + $message = __('Fluent Boards could not verify upload-directory protection. Writing .htaccess rules does not confirm that your web server enforces them.', 'fluent-boards');
44 + }
45 + $uploads = wp_upload_dir();
46 + $folder = apply_filters('fluent_boards/upload_folder_name', FLUENT_BOARDS_UPLOAD_DIR);
47 + $url = trailingslashit($uploads['baseurl']) . trim($folder, '/');
48 + echo '<div class="notice notice-warning"><p>' . esc_html($message) . '</p><p>'
49 + . esc_html__('Nginx requires a server rule denying this upload URL and every path beneath it. Apache must honor the generated .htaccess authorization rules. Verify that direct file requests return 403 or 404. This check retries every five minutes.', 'fluent-boards')
50 + . '</p><p><code>' . esc_html($url) . '</code></p></div>';
51 + });
52 + }
53 +});
54 +
22 55 /*
23 56 * Add custom CSS for fbs_notice.
24 57 */
25 58 add_action('admin_head', function () {
@@ -51,9 +84,9 @@
51 84 $app->addCustomAction('subtask_deleted_activity', 'ActivityHandler@logSubtaskDeletedActivity', 10, 2);
52 85 $app->addCustomAction('subtask_group_deleted_activity', 'ActivityHandler@logSubtaskGroupDeletedActivity', 10, 2);
53 86 $app->addCustomAction('subtask_group_title_updated', 'ActivityHandler@logSubtaskGroupTitleUpdatedActivity', 10, 2);
54 87 $app->addCustomAction('task_completed_activity', 'ActivityHandler@logTaskCompletedOrReopenActivity', 10, 2);
55 -$app->addCustomAction('task_stage_updated', 'ActivityHandler@logTaskStageUpdatedActivity', 10, 2);
88 +$app->addCustomAction('task_stage_updated', 'ActivityHandler@logTaskStageUpdatedActivity', 10, 3);
56 89 $app->addCustomAction('task_assignee_added', 'ActivityHandler@logAssigneeAddedActivity', 10, 2);
57 90 $app->addCustomAction('task_assignee_removed', 'ActivityHandler@logAssigneeRemovedActivity', 10, 2);
58 91 $app->addCustomAction('task_added_from_fluent_form', 'ActivityHandler@taskAddedFromFluentForms', 10, 1);
59 92 $app->addCustomAction('repeat_task_created', 'ActivityHandler@logRepeatTaskCreatedActivity', 10, 2);
@@ -62,11 +95,14 @@
62 95 $app->addCustomAction('task_created', 'ActivityHandler@logTaskCreationActivity', 10, 1);
63 96 $app->addCustomAction('task_content_updated', 'ActivityHandler@logTaskContentUpdatedActivity', 10, 3);
64 97 $app->addCustomAction('task_deleted', 'TaskHandler@taskDeleted', 10, 1);
65 98 $app->addCustomAction('task_archived', 'ActivityHandler@taskArchived', 10, 1);
66 -//$app->addCustomAction('task_custom_field_changed', 'ActivityHandler@logCustomFieldActivity', 10, 5); // commented for now, will implement later
99 +$app->addCustomAction('task_custom_field_changed', 'ActivityHandler@logCustomFieldActivity', 10, 5);
100 +$app->addCustomAction('board_custom_field_created', 'BoardHandler@customFieldCreated', 10, 1);
101 +$app->addCustomAction('board_custom_field_updated', 'BoardHandler@customFieldUpdated', 10, 2);
67 102
68 103 $app->addCustomAction('board_created', 'BoardHandler@boardCreated', 10, 1);
104 +$app->addCustomAction('board_created_from_automation', 'BoardHandler@boardCreatedFromAutomation', 10, 1);
69 105 $app->addCustomAction('before_board_deleted', 'BoardHandler@beforeBoardDeleted', 10, 2);
70 106 $app->addCustomAction('board_updated', 'BoardHandler@boardUpdated', 10, 2);
71 107 $app->addCustomAction('stage_updated', 'BoardHandler@boardStageUpdated', 10, 3);
72 108 $app->addCustomAction('board_stage_moved', 'BoardHandler@boardStageMoved', 10, 2);
@@ -79,8 +115,9 @@
79 115 $app->addCustomAction('task_deleted', 'BoardHandler@taskdeleted', 10, 1);
80 116 $app->addCustomAction('task_moved_from_board', 'BoardHandler@taskMovedFromBoard', 10, 3);
81 117 $app->addCustomAction('task_moved_from_board', 'ActivityHandler@taskMovedFromBoard', 10, 3);
82 118 $app->addCustomAction('task_archived', 'BoardHandler@taskArchivedOnBoard', 10, 1);
119 +$app->addCustomAction('tasks_moved_between_stages', 'BoardHandler@tasksMovedBetweenStages', 10, 4);
83 120 $app->addCustomAction('board_member_added', 'BoardHandler@boardMemberAdded', 10, 2);
84 121 $app->addCustomAction('board_viewer_added', 'BoardHandler@boardViewerAdded', 10, 2);
85 122 $app->addCustomAction('board_member_removed', 'BoardHandler@boardMemberRemoved', 10, 2);
86 123 $app->addCustomAction('board_admin_added', 'BoardHandler@boardAdminAdded', 10, 2);
@@ -103,9 +140,9 @@
103 140 $app->addCustomAction('task_start_date_changed', 'NotificationHandler@changeStartDateNotification', 10, 2);
104 141 $app->addCustomAction('task_stage_updated', 'NotificationHandler@changeStageNotification', 10, 2);
105 142 $app->addCustomAction('task_priority_changed', 'NotificationHandler@changePriorityNotification', 10, 2);
106 143 $app->addCustomAction('task_archived', 'NotificationHandler@taskArchiveNotification', 10, 1);
107 -$app->addCustomAction('task_content_updated', 'NotificationHandler@changeTitleOrDescriptionNotification', 10, 3);
144 +$app->addCustomAction('task_content_updated', 'NotificationHandler@changeTitleNotification', 10, 3);
108 145 //$app->addCustomAction('description_changed_notification', 'NotificationHandler@changeDescriptionNotification', 10, 1);
109 146 $app->addCustomAction('board_changed_notification', 'NotificationHandler@changeBoardNotification', 10, 2);
110 147 $app->addCustomAction('task_assignee_added', 'NotificationHandler@assigneeAddedNotification', 10, 2);
111 148 $app->addCustomAction('task_assignee_removed', 'NotificationHandler@assigneeRemovedNotification', 10, 2);
@@ -122,11 +159,12 @@
122 159 $app->addCustomAction('one_time_schedule_send_email_for_removed_from_task', 'ScheduleHandler@sendEmailForChangeStage', 10, 3);
123 160
124 161 $app->addCustomAction('task_attachment_added', 'ActivityHandler@taskAttachmentAdded', 10, 1);
125 162 $app->addCustomAction('task_attachment_deleted', 'ActivityHandler@taskAttachmentDeleted', 10, 1);
126 -$app->addCustomAction('task_attachment_deleted', 'TaskHandler@taskAttachmentDeleted', 10, 1);
163 +$app->addCustomAction('task_attachment_deleted', 'TaskHandler@taskAttachmentDeleted', 10, 2);
127 164 // Removed: direct call is made from Comment::deleting to TaskHandler@commentImageDeleted
128 165 $app->addAction('deleted_user', 'BoardHandler@deleteUserRelatedData', 10, 3);
166 +$app->addAction('fluent_boards/delete_remote_attachment_files', 'FileHandler@deleteRemoteAttachmentFiles', 10, 1);
129 167
130 168 $app->addCustomAction('task_created', 'TaskHandler@onTaskCreated', 10, 1);
131 169 $app->addCustomAction('comment_created', 'TaskHandler@onCommentCreated', 10, 1);
132 170 $app->addCustomAction('assign_another_user', 'TaskHandler@onAssignAnotherUser', 10, 2);
@@ -211,8 +249,10 @@
211 249 ];
212 250
213 251 return $handlers;
214 252 });
253 +
254 +\FluentBoards\App\Services\MCPAccessService::registerHooks();
215 255
216 256 add_action('init', function () {
217 257 if (!function_exists('wp_register_ability')) {
218 258 return;