PluginProbe
Taskbuilder – Project Management & Task Management Tool With Kanban Board / 6.0.6
Taskbuilder – Project Management & Task Management Tool With Kanban Board v6.0.6
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 1.0.5 All 58 releases
← All changes | includes/admin/settings/wppm_set_edit_task_status.php +41 -32 1.0.46.0.6 View file →
@@ -1,32 +1,41 @@
1 -<?php
2 -if ( ! defined( 'ABSPATH' ) ) {
3 - exit; // Exit if accessed directly
4 -}
5 -global $current_user, $wpdb;
6 -
7 -if (!($current_user->ID && $current_user->has_cap('manage_options'))) {exit;}
8 -
9 -$status_id = isset($_POST) && isset($_POST['status_id']) ? intval(sanitize_text_field($_POST['status_id'])) : '';
10 -if (!$status_id) {exit;}
11 -
12 -$status_name = isset($_POST) && isset($_POST['status_name']) ? sanitize_text_field($_POST['status_name']) : '';
13 -if (!$status_name) {exit;}
14 -
15 -$status_color = isset($_POST) && isset($_POST['status_color']) ? sanitize_text_field($_POST['status_color']) : '';
16 -if (!$status_color) {exit;}
17 -
18 -$status_bg_color = isset($_POST) && isset($_POST['status_bg_color']) ? sanitize_text_field($_POST['status_bg_color']) : '';
19 -if (!$status_bg_color) {exit;}
20 -
21 -if ($status_color==$status_bg_color) {
22 - echo '{ "sucess_status":"0","messege":"'.__('Status color and background color should not be same.','taskbuilder').'" }';
23 - die();
24 -}
25 -$values= array(
26 - 'name'=>$status_name,
27 - 'color'=>$status_color,
28 - 'bg_color'=>$status_bg_color
29 -);
30 -$wpdb->update($wpdb->prefix.'wppm_task_statuses',$values,array('id'=>intval($status_id)));
31 -echo '{ "sucess_status":"1","messege":"Success" }';
32 -?>
1 +<?php
2 +if ( ! defined( 'ABSPATH' ) ) {
3 + exit; // Exit if accessed directly
4 +}
5 +global $current_user, $wpdb;
6 +
7 +if (!($current_user->ID && $current_user->has_cap('manage_options') || ($current_user->ID && $current_user->has_cap('wppm_admin')))) {exit;}
8 +
9 +if ( check_ajax_referer( 'wppm_set_edit_task_status', '_ajax_nonce', false ) != 1 ) {
10 + wp_send_json_error( 'Unauthorised request!', 401 );
11 +}
12 +
13 +$status_id = isset($_POST) && isset($_POST['status_id']) ? absint(sanitize_text_field(wp_unslash($_POST['status_id']))) : '';
14 +if (!$status_id) {exit;}
15 +$status_id = absint($status_id);
16 +
17 +$status_name = isset($_POST) && isset($_POST['status_name']) ? sanitize_text_field(wp_unslash($_POST['status_name'])) : '';
18 +if (!$status_name) {exit;}
19 +
20 +$status_color = isset($_POST) && isset($_POST['status_color']) ? sanitize_text_field(wp_unslash($_POST['status_color'])) : '';
21 +if (!$status_color) {exit;}
22 +
23 +$status_bg_color = isset($_POST) && isset($_POST['status_bg_color']) ? sanitize_text_field(wp_unslash($_POST['status_bg_color'])) : '';
24 +if (!$status_bg_color) {exit;}
25 +
26 +if ($status_color==$status_bg_color) {
27 + echo '{ "sucess_status":"0","messege":"'.esc_html__('Status color and background color should not be same.','taskbuilder').'" }';
28 + die();
29 +}
30 +$values= array(
31 + 'name'=>esc_sql($status_name),
32 + 'color'=>esc_sql($status_color),
33 + 'bg_color'=>esc_sql($status_bg_color)
34 +);
35 +$wpdb->update($wpdb->prefix.'wppm_task_statuses',$values,array('id'=>intval($status_id)));
36 +echo wp_json_encode( array(
37 + 'sucess_status' => 1,
38 + 'messege' => esc_html__( 'Success', 'taskbuilder' ),
39 +) );
40 +wp_die();
41 +?>