Changeset 1866674
- Timestamp:
- 04/30/2018 10:16:39 PM (8 years ago)
- File:
-
- 1 edited
-
teamacle/trunk/teamacle.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
teamacle/trunk/teamacle.php
r1866664 r1866674 224 224 register_setting('teamacle', 'teamacle'); 225 225 $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¢er_state=0'; 235 wp_safe_redirect(admin_url($redirect_to)); 236 } 226 237 if(!empty($options['center_id'])) { 227 238 wp_enqueue_script('jquery'); … … 259 270 } 260 271 } 261 console.log('center code: ' + centerCode);262 272 var checkUrl = 'api_1.0_user_queryChatCenterUsages.do' 263 273 var sucCallback = function (result) { … … 278 288 <?php 279 289 } 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¢er_state=0';288 wp_safe_redirect(admin_url($redirect_to));289 }290 290 } 291 291
Note: See TracChangeset
for help on using the changeset viewer.