Plugin Directory

Changeset 2775544


Ignore:
Timestamp:
08/25/2022 12:51:39 PM (4 years ago)
Author:
brainvireinfo
Message:

Apply nonce

Location:
wp-users-disable/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-users-disable/trunk/admin-option.php

    r2759205 r2775544  
    4646    public function dwul_create_submit_buton( $value ) {
    4747
    48          echo '<a class=" button-primary"  id="' . esc_attr( $value['id'] ) . '"  style="float: left; margin: 75px 0px 0px;" />Disableuser</a><br/>';
     48        $nonce = wp_create_nonce( 'disable_user_nonce' );
     49        echo '<a class=" button-primary" data-nonce="'.$nonce.'"  id="' . esc_attr( $value['id'] ) . '"  style="float: left; margin: 75px 0px 0px;" />Disableuser</a><br/>';
    4950
    5051    }
  • wp-users-disable/trunk/ajax.js

    r1432868 r2775544  
    3333                            action: 'dwul_action_callback',
    3434                            useremail: useremail,
     35                            nonce_data : jQuery( this ).data( 'nonce' )
    3536                        },
    3637                        beforeSend: function() {
     
    4142                        success: function(response) {
    4243                           
    43                            
     44                            if(response == 90){                           
     45                              jQuery("#adminroleerror").html("Permission Denied").fadeIn().delay(2000).fadeOut('slow'); 
     46                              jQuery("#processimage").hide();
     47                              return false; 
     48                            }
    4449                           
    4550                             if(response == 11){
  • wp-users-disable/trunk/custom-ajax.php

    r2759205 r2775544  
    3232        global $wpdb;
    3333        global $disableemail;
     34        if ( !wp_verify_nonce($_REQUEST['nonce_data'], 'disable_user_nonce') ){
     35            $successresponse = '90';
     36            echo esc_html( $successresponse );
     37            die();
     38        }
    3439        $exitingarray = array();
    3540        $disableemail = isset( $_REQUEST['useremail'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['useremail'] ) ) : '';
Note: See TracChangeset for help on using the changeset viewer.