|
@@ 575-582 (lines=8) @@
|
| 572 |
|
add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) ); |
| 573 |
|
|
| 574 |
|
$signed = $this->verify_xml_rpc_signature(); |
| 575 |
|
if ( $signed && ! is_wp_error( $signed ) ) { |
| 576 |
|
// The actual API methods. |
| 577 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) ); |
| 578 |
|
} else { |
| 579 |
|
// The jetpack.authorize method should be available for unauthenticated users on a site with an |
| 580 |
|
// active Jetpack connection, so that additional users can link their account. |
| 581 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
| 582 |
|
} |
| 583 |
|
} else { |
| 584 |
|
// The bootstrap API methods. |
| 585 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
|
@@ 583-591 (lines=9) @@
|
| 580 |
|
// active Jetpack connection, so that additional users can link their account. |
| 581 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
| 582 |
|
} |
| 583 |
|
} else { |
| 584 |
|
// The bootstrap API methods. |
| 585 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
| 586 |
|
$signed = $this->verify_xml_rpc_signature(); |
| 587 |
|
if ( $signed && ! is_wp_error( $signed ) ) { |
| 588 |
|
// the jetpack Provision method is available for blog-token-signed requests |
| 589 |
|
add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) ); |
| 590 |
|
} |
| 591 |
|
} |
| 592 |
|
|
| 593 |
|
// Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on. |
| 594 |
|
add_filter( 'pre_option_enable_xmlrpc', '__return_true' ); |