Plugin Directory


Ignore:
Timestamp:
06/01/2024 10:28:10 AM (11 months ago)
Author:
minhgsvn
Message:

init v4.3.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • popup-builder/trunk/com/classes/Ajax.php

    r3085485 r3096000  
    9292        }
    9393        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     94        /**
     95         * We only allow administrator to do this action
     96        */         
     97        if ( ! current_user_can( 'manage_options' ) ) {         
     98            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     99        }
    94100        if (!isset($_POST['post_ID'])){
    95101            wp_die(0);
     
    130136    {
    131137        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     138        /**
     139         * We only allow administrator to do this action
     140        */         
     141        if ( ! current_user_can( 'manage_options' ) ) {         
     142            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     143        }
    132144        update_option('SGPBCloseReviewPopup-notification', true);
    133145        do_action('sgpbGetNotifications');
     
    138150    {
    139151        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     152        /**
     153         * We only allow administrator to do this action
     154        */         
     155        if ( ! current_user_can( 'manage_options' ) ) {         
     156            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     157        }
    140158        $messageType = isset($_POST['messageType']) ? sanitize_text_field($_POST['messageType']) : '';
    141159
     
    173191    {
    174192        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     193        /**
     194         * We only allow administrator to do this action
     195        */         
     196        if ( ! current_user_can( 'manage_options' ) ) {         
     197            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     198        }
    175199        if (!isset($_POST['popupId'])){
    176200            wp_die(0);
     
    202226    {
    203227        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     228        /**
     229         * We only allow administrator to do this action
     230        */         
     231        if ( ! current_user_can( 'manage_options' ) ) {         
     232            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     233        }
    204234        update_option('sgpbDontShowAskReviewBanner', 1);
    205235        echo esc_html(SGPB_AJAX_STATUS_TRUE);
     
    210240    {
    211241        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     242        /**
     243         * We only allow administrator to do this action
     244        */         
     245        if ( ! current_user_can( 'manage_options' ) ) {         
     246            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     247        }
    212248        update_option('sgpb_alert_problems', 1);
    213249        echo esc_html(SGPB_AJAX_STATUS_TRUE);
     
    218254    {
    219255        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     256        /**
     257         * We only allow administrator to do this action
     258        */         
     259        if ( ! current_user_can( 'manage_options' ) ) {         
     260            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     261        }
    220262        update_option('sgpb_extensions_updated', 1);
    221263        echo esc_html(SGPB_AJAX_STATUS_TRUE);
     
    226268    {
    227269        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     270        /**
     271         * We only allow administrator to do this action
     272        */         
     273        if ( ! current_user_can( 'manage_options' ) ) {         
     274            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     275        }
    228276        update_option('sgpb-hide-support-banner', 1);
    229277        do_action('sgpbGetNotifications');
     
    234282    {
    235283        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     284        /**
     285         * We only allow administrator to do this action
     286        */         
     287        if ( ! current_user_can( 'manage_options' ) ) {         
     288            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     289        }
    236290        update_option('sgpb-hide-license-notice-banner', 1);
    237291        wp_die();
     
    241295    {
    242296        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
    243 
     297       
    244298        if(isset($_GET['sg_popup_preview_id']) && !isset($_POST['params'])) {
    245299            wp_die(0);
     
    276330
    277331        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
    278 
     332        /**
     333         * We only allow administrator to do this action
     334        */         
     335        if ( ! current_user_can( 'manage_options' ) ) {         
     336            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     337        }
    279338        if (empty($_POST['subscribersId'])){
    280339            wp_die();
     
    293352
    294353        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     354        /**
     355         * We only allow administrator to do this action
     356        */         
     357        if ( ! current_user_can( 'manage_options' ) ) {         
     358            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     359        }
    295360        $status = SGPB_AJAX_STATUS_FALSE;
    296361        $firstName = isset($_POST['firstName']) ? sanitize_text_field($_POST['firstName']) : '';
     
    332397    {
    333398        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     399        /**
     400         * We only allow administrator to do this action
     401        */         
     402        if ( ! current_user_can( 'manage_options' ) ) {         
     403            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     404        }
    334405        $formId = isset($_POST['popupSubscriptionList']) ? (int)sanitize_text_field($_POST['popupSubscriptionList']) : '';
    335406        $fileURL = isset($_POST['importListURL']) ? sanitize_text_field($_POST['importListURL']) : '';
     
    346417    {
    347418        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     419        /**
     420         * We only allow administrator to do this action
     421        */         
     422        if ( ! current_user_can( 'manage_options' ) ) {         
     423            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     424        }
    348425        ob_start();
    349426        require_once SG_POPUP_VIEWS_PATH.'importPopupsView.php';
     
    358435    {
    359436        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     437        /**
     438         * We only allow administrator to do this action
     439        */         
     440        if ( ! current_user_can( 'manage_options' ) ) {         
     441            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     442        }
    360443        @ini_set('auto_detect_line_endings', '1');
    361444        $formId = isset($_POST['popupSubscriptionList']) ? (int)sanitize_text_field($_POST['popupSubscriptionList']) : '';
     
    407490        }
    408491        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     492        /**
     493         * We only allow administrator to do this action
     494        */         
     495        if ( ! current_user_can( 'manage_options' ) ) {         
     496            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     497        }
     498       
    409499        global $wpdb;
    410500
     
    438528    {
    439529        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
    440 
     530        /**
     531         * We only allow administrator to do this action
     532        */         
     533        if ( ! current_user_can( 'manage_options' ) ) {         
     534            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     535        }   
    441536        $url = isset($_POST['iframeUrl']) ? esc_url_raw($_POST['iframeUrl']) : '';
    442537        $status = SGPB_AJAX_STATUS_FALSE;
     
    562657    {
    563658        check_ajax_referer(SG_AJAX_NONCE, 'nonce');
     659        /**
     660         * We only allow administrator to do this action
     661        */         
     662        if ( ! current_user_can( 'manage_options' ) ) {         
     663            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     664        }
    564665        // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    565666        $submissionData = isset($_POST['formData']) ? $_POST['formData'] : "[]";
     
    624725    {
    625726        check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
     727        /**
     728         * We only allow administrator to do this action
     729        */         
     730        if ( ! current_user_can( 'manage_options' ) ) {         
     731            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     732        }
    626733
    627734        $postTypeName = isset($_POST['searchKey']) ? sanitize_text_field($_POST['searchKey']) : ''; // TODO strongly validate postTypeName example: use ENUM
     
    676783    {
    677784        check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
     785        /**
     786         * We only allow administrator to do this action
     787        */         
     788        if ( ! current_user_can( 'manage_options' ) ) {         
     789            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     790        }
    678791        global $SGPB_DATA_CONFIG_ARRAY;
    679792
     
    698811    {
    699812        check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
     813        /**
     814         * We only allow administrator to do this action
     815        */         
     816        if ( ! current_user_can( 'manage_options' ) ) {         
     817            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     818        }
    700819        $data = '';
    701820        global $SGPB_DATA_CONFIG_ARRAY;
     
    720839    {
    721840        check_ajax_referer(SG_AJAX_NONCE, 'nonce_ajax');
     841        /**
     842         * We only allow administrator to do this action
     843        */         
     844        if ( ! current_user_can( 'manage_options' ) ) {         
     845            wp_die(esc_html__('You do not have permission to do this action!', 'popup-builder'));
     846        }
    722847        $data = '';
    723848        global $SGPB_DATA_CONFIG_ARRAY;
Note: See TracChangeset for help on using the changeset viewer.