|
@@ 557-564 (lines=8) @@
|
| 554 |
|
add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) ); |
| 555 |
|
|
| 556 |
|
$signed = $this->verify_xml_rpc_signature(); |
| 557 |
|
if ( $signed && ! is_wp_error( $signed ) ) { |
| 558 |
|
// The actual API methods. |
| 559 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) ); |
| 560 |
|
} else { |
| 561 |
|
// The jetpack.authorize method should be available for unauthenticated users on a site with an |
| 562 |
|
// active Jetpack connection, so that additional users can link their account. |
| 563 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
| 564 |
|
} |
| 565 |
|
} else { |
| 566 |
|
// The bootstrap API methods. |
| 567 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
|
@@ 565-573 (lines=9) @@
|
| 562 |
|
// active Jetpack connection, so that additional users can link their account. |
| 563 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
| 564 |
|
} |
| 565 |
|
} else { |
| 566 |
|
// The bootstrap API methods. |
| 567 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
| 568 |
|
$signed = $this->verify_xml_rpc_signature(); |
| 569 |
|
if ( $signed && ! is_wp_error( $signed ) ) { |
| 570 |
|
// the jetpack Provision method is available for blog-token-signed requests |
| 571 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) ); |
| 572 |
|
} |
| 573 |
|
} |
| 574 |
|
|
| 575 |
|
// Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on. |
| 576 |
|
add_filter( 'pre_option_enable_xmlrpc', '__return_true' ); |