PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 6.0.7
Taskbuilder – Project Management & Task Management Tool With Kanban Board v6.0.7
6.0.7 6.0.6 6.0.5 6.0.2 6.0.3 6.0.4 6.0.1 6.0.0 5.0.8 5.0.9 4.0.9 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 All 59 releases
← All changes | includes/admin/projects/wppm_create_project.php +6 -2 6.0.4 → 6.0.7 View file →
@@ -6,9 +6,11 @@
6 6 if ( check_ajax_referer( 'wppm_create_project', '_ajax_nonce', false ) != 1 ) {
7 7 wp_send_json_error( 'Unauthorised request!', 401 );
8 8 }
9 9 $wppm_current_user_capability = get_user_meta( $current_user->ID, 'wppm_capability', true );
10 -if (($current_user->has_cap('manage_options')) || $wppm_current_user_capability == 'wppm_manager'|| $wppm_current_user_capability == 'wppm_admin') {
10 +$wppm_can_create_project = ($current_user->has_cap('manage_options')) || $wppm_current_user_capability == 'wppm_manager'|| $wppm_current_user_capability == 'wppm_admin';
11 +$wppm_can_create_project = apply_filters( 'wppm_can_create_project', $wppm_can_create_project, $current_user->ID );
12 +if ($wppm_can_create_project) {
11 13 // project name
12 14 $name = isset($_POST['name']) ? sanitize_text_field(wp_unslash($_POST['name'])) : '';
13 15 if($name) $args['name'] = $name;
14 16
@@ -56,7 +58,9 @@
56 58 }
57 59 $auth_code = $wppmfunction->getRandomString(10);
58 60 $wppmfunction->add_project_meta($project_id,'public_project',$public_proj);
59 61 $wppmfunction->add_project_meta($project_id,'project_auth_code',$auth_code);
62 +} else {
63 + wp_send_json_error( 'Permission denied', 403 );
60 64 }
61 65
62 -do_action('wppm_after_project_created',$project_id);
66 +do_action('wppm_after_project_created',$project_id);