Plugin Directory

Changeset 1866674


Ignore:
Timestamp:
04/30/2018 10:16:39 PM (8 years ago)
Author:
teamacle
Message:

delete center update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • teamacle/trunk/teamacle.php

    r1866664 r1866674  
    224224    register_setting('teamacle', 'teamacle');
    225225    $options = get_option('teamacle');
     226    if (isset($_GET['state']) && wp_verify_nonce($_GET[ 'state'], 'teamacle-oauth') && current_user_can('manage_options') && isset($_GET['center_id']) ) {
     227        $teamacle_val = new TeamacleVal($_GET, function($x) { return wp_kses(trim($x), array()); });
     228        update_option("teamacle", array("center_id" => $teamacle_val->validCenterId()));
     229        echo "console.log('$teamacle_val->validCenterId()');";
     230        $redirect_to = 'options-general.php?page=Teamacle&authenticated=1';
     231        wp_safe_redirect(admin_url($redirect_to));
     232    }
     233    if (isset($_GET['state']) && wp_verify_nonce($_GET[ 'state'], 'teamacle-oauth') && current_user_can('manage_options') && isset($_GET['center_state']) ) {
     234        $redirect_to = 'options-general.php?page=Teamacle&center_state=0';
     235        wp_safe_redirect(admin_url($redirect_to));
     236    }
    226237    if(!empty($options['center_id'])) {
    227238        wp_enqueue_script('jquery');
     
    259270                        }
    260271                    }
    261                     console.log('center code: ' + centerCode);
    262272                    var checkUrl = 'api_1.0_user_queryChatCenterUsages.do'
    263273                    var sucCallback = function (result) {
     
    278288            <?php
    279289    }
    280     if (isset($_GET['state']) && wp_verify_nonce($_GET[ 'state'], 'teamacle-oauth') && current_user_can('manage_options') && isset($_GET['center_id']) ) {
    281         $teamacle_val = new TeamacleVal($_GET, function($x) { return wp_kses(trim($x), array()); });
    282         update_option("teamacle", array("center_id" => $teamacle_val->validCenterId()));
    283         $redirect_to = 'options-general.php?page=Teamacle&authenticated=1';
    284         wp_safe_redirect(admin_url($redirect_to));
    285     }
    286     if (isset($_GET['state']) && wp_verify_nonce($_GET[ 'state'], 'teamacle-oauth') && current_user_can('manage_options') && isset($_GET['center_state']) ) {
    287         $redirect_to = 'options-general.php?page=Teamacle&center_state=0';
    288         wp_safe_redirect(admin_url($redirect_to));
    289     }
    290290}
    291291
Note: See TracChangeset for help on using the changeset viewer.