diff options
author | Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org> | 2015-05-01 00:40:49 +0000 |
---|---|---|
committer | Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org> | 2015-05-01 00:40:49 +0000 |
commit | c64ce3ae8de09092f9570ab88a68fe920b0fd970 (patch) | |
tree | a9959002055a8bdff0ee46bf82ca6a2a39bf00cd /plugins/jetpack/class.jetpack-xmlrpc-server.php | |
parent | Add easy-table plugin, requested by hwoarang (diff) | |
download | blogs-gentoo-c64ce3ae8de09092f9570ab88a68fe920b0fd970.tar.gz blogs-gentoo-c64ce3ae8de09092f9570ab88a68fe920b0fd970.tar.bz2 blogs-gentoo-c64ce3ae8de09092f9570ab88a68fe920b0fd970.zip |
Update plugins and themes to the latest versions.
Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org>
Diffstat (limited to 'plugins/jetpack/class.jetpack-xmlrpc-server.php')
-rw-r--r-- | plugins/jetpack/class.jetpack-xmlrpc-server.php | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/plugins/jetpack/class.jetpack-xmlrpc-server.php b/plugins/jetpack/class.jetpack-xmlrpc-server.php index e539b25f..42a6cd12 100644 --- a/plugins/jetpack/class.jetpack-xmlrpc-server.php +++ b/plugins/jetpack/class.jetpack-xmlrpc-server.php @@ -32,15 +32,19 @@ class Jetpack_XMLRPC_Server { 'jetpack.getPosts' => array( $this, 'get_posts' ), 'jetpack.getComment' => array( $this, 'get_comment' ), 'jetpack.getComments' => array( $this, 'get_comments' ), + 'jetpack.disconnectBlog' => array( $this, 'disconnect_blog' ), + 'jetpack.unlinkUser' => array( $this, 'unlink_user' ), ) ); if ( isset( $core_methods['metaWeblog.editPost'] ) ) { $jetpack_methods['metaWeblog.newMediaObject'] = $core_methods['metaWeblog.newMediaObject']; $jetpack_methods['jetpack.updateAttachmentParent'] = array( $this, 'update_attachment_parent' ); } + + $jetpack_methods = apply_filters( 'jetpack_xmlrpc_methods', $jetpack_methods, $core_methods, $user ); } - return apply_filters( 'jetpack_xmlrpc_methods', $jetpack_methods, $core_methods, $user ); + return apply_filters( 'jetpack_xmlrpc_unauthenticated_methods', $jetpack_methods, $core_methods ); } /** @@ -49,7 +53,6 @@ class Jetpack_XMLRPC_Server { function bootstrap_xmlrpc_methods() { return array( 'jetpack.verifyRegistration' => array( $this, 'verify_registration' ), - 'jetpack.verifyAction' => array( $this, 'verify_action' ), ); } @@ -108,6 +111,7 @@ class Jetpack_XMLRPC_Server { * @return WP_User|IXR_Error */ function login() { + Jetpack::init()->require_jetpack_authentication(); $user = wp_authenticate( 'username', 'password' ); if ( is_wp_error( $user ) ) { if ( 'authentication_failed' == $user->get_error_code() ) { // Generic error could mean most anything. @@ -203,6 +207,27 @@ class Jetpack_XMLRPC_Server { } /** + * Disconnect this blog from the connected wordpress.com account + * @return boolean + */ + function disconnect_blog() { + Jetpack::log( 'disconnect' ); + Jetpack::disconnect(); + + return true; + } + + /** + * Unlink a user from WordPress.com + * + * This will fail if called by the Master User. + */ + function unlink_user() { + Jetpack::log( 'unlink' ); + return Jetpack::unlink_user(); + } + + /** * Returns what features are available. Uses the slug of the module files. * * @return array|IXR_Error @@ -342,10 +367,10 @@ class Jetpack_XMLRPC_Server { // needed? require_once ABSPATH . 'wp-admin/includes/admin.php'; - require_once dirname( __FILE__ ) . '/class.json-api.php'; + require_once JETPACK__PLUGIN_DIR . 'class.json-api.php'; $api = WPCOM_JSON_API::init( $method, $url, $post_body ); $api->token_details['user'] = $user_details; - require_once dirname( __FILE__ ) . '/class.json-api-endpoints.php'; + require_once JETPACK__PLUGIN_DIR . 'class.json-api-endpoints.php'; $display_errors = ini_set( 'display_errors', 0 ); ob_start(); |