| @@ -1430,8 +1430,12 @@ | ||
| 1430 | 1430 | if ( ! is_super_admin() ) { |
| 1431 | 1431 | wp_send_json_error( array( 'msg' => __( 'Action not allowed for this user.', 'visualizer' ) ) ); |
| 1432 | 1432 | } |
| 1433 | 1433 | |
| 1434 | + if ( ! Visualizer_Module::is_pro() ) { | |
| 1435 | + wp_send_json_error( array( 'msg' => __( 'Feature is not available.', 'visualizer' ) ) ); | |
| 1436 | + } | |
| 1437 | + | |
| 1434 | 1438 | $params = wp_parse_args( $_POST['params'] ); |
| 1435 | 1439 | $chart_id = filter_var( $params['chart_id'], FILTER_VALIDATE_INT ); |
| 1436 | 1440 | $query = trim( $params['query'], ';' ); |
| 1437 | 1441 | |
| @@ -1450,8 +1454,19 @@ | ||
| 1450 | 1454 | * @access public |
| 1451 | 1455 | */ |
| 1452 | 1456 | public function saveQuery() { |
| 1453 | 1457 | check_ajax_referer( Visualizer_Plugin::ACTION_SAVE_DB_QUERY . Visualizer_Plugin::VERSION, 'security' ); |
| 1458 | + | |
| 1459 | + if ( ! current_user_can( 'administrator' ) ) { | |
| 1460 | + wp_send_json_error( array( 'msg' => __( 'Action not allowed for this user.', 'visualizer' ) ) ); | |
| 1461 | + } | |
| 1462 | + if ( ! is_super_admin() ) { | |
| 1463 | + wp_send_json_error( array( 'msg' => __( 'Action not allowed for this user.', 'visualizer' ) ) ); | |
| 1464 | + } | |
| 1465 | + | |
| 1466 | + if ( ! Visualizer_Module::is_pro() ) { | |
| 1467 | + wp_send_json_error( array( 'msg' => __( 'Feature is not available.', 'visualizer' ) ) ); | |
| 1468 | + } | |
| 1454 | 1469 | |
| 1455 | 1470 | $chart_id = filter_input( |
| 1456 | 1471 | INPUT_GET, |
| 1457 | 1472 | 'chart', |