|
@@ 341-354 (lines=14) @@
|
| 338 |
|
/** |
| 339 |
|
* Set invalid user token. |
| 340 |
|
*/ |
| 341 |
|
public function admin_post_set_invalid_user_tokens() { |
| 342 |
|
check_admin_referer( 'set-invalid-user-tokens' ); |
| 343 |
|
$this->notice_type = 'jetpack-broken'; |
| 344 |
|
|
| 345 |
|
$new_tokens = array(); |
| 346 |
|
|
| 347 |
|
foreach ( Jetpack_Options::get_option( 'user_tokens' ) as $id => $token ) { |
| 348 |
|
$new_tokens[ $id ] = sprintf( $this->invalid_user_token, $id ); |
| 349 |
|
} |
| 350 |
|
|
| 351 |
|
Jetpack_Options::update_option( 'user_tokens', $new_tokens ); |
| 352 |
|
|
| 353 |
|
$this->admin_post_redirect_referrer(); |
| 354 |
|
} |
| 355 |
|
|
| 356 |
|
/** |
| 357 |
|
* Set invalid current user token. |
|
@@ 359-371 (lines=13) @@
|
| 356 |
|
/** |
| 357 |
|
* Set invalid current user token. |
| 358 |
|
*/ |
| 359 |
|
public function admin_post_set_invalid_current_user_token() { |
| 360 |
|
check_admin_referer( 'set-invalid-current-user-token' ); |
| 361 |
|
$this->notice_type = 'jetpack-broken'; |
| 362 |
|
|
| 363 |
|
$tokens = Jetpack_Options::get_option( 'user_tokens' ); |
| 364 |
|
|
| 365 |
|
$id = get_current_user_id(); |
| 366 |
|
$tokens[ $id ] = sprintf( $this->invalid_user_token, $id ); |
| 367 |
|
|
| 368 |
|
Jetpack_Options::update_option( 'user_tokens', $tokens ); |
| 369 |
|
|
| 370 |
|
$this->admin_post_redirect_referrer(); |
| 371 |
|
} |
| 372 |
|
|
| 373 |
|
/** |
| 374 |
|
* Clear blog token. |