|
@@ 545-552 (lines=8) @@
|
| 542 |
|
add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) ); |
| 543 |
|
|
| 544 |
|
$signed = $this->verify_xml_rpc_signature(); |
| 545 |
|
if ( $signed && ! is_wp_error( $signed ) ) { |
| 546 |
|
// The actual API methods. |
| 547 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) ); |
| 548 |
|
} else { |
| 549 |
|
// The jetpack.authorize method should be available for unauthenticated users on a site with an |
| 550 |
|
// active Jetpack connection, so that additional users can link their account. |
| 551 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
| 552 |
|
} |
| 553 |
|
} else { |
| 554 |
|
// The bootstrap API methods. |
| 555 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
|
@@ 553-561 (lines=9) @@
|
| 550 |
|
// active Jetpack connection, so that additional users can link their account. |
| 551 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
| 552 |
|
} |
| 553 |
|
} else { |
| 554 |
|
// The bootstrap API methods. |
| 555 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
| 556 |
|
$signed = $this->verify_xml_rpc_signature(); |
| 557 |
|
if ( $signed && ! is_wp_error( $signed ) ) { |
| 558 |
|
// the jetpack Provision method is available for blog-token-signed requests |
| 559 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) ); |
| 560 |
|
} |
| 561 |
|
} |
| 562 |
|
|
| 563 |
|
// Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on. |
| 564 |
|
add_filter( 'pre_option_enable_xmlrpc', '__return_true' ); |