diff --git a/xmlrpc.php b/xmlrpc.php index b30b8cc153..cfcbf15edb 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -527,9 +527,23 @@ class wp_xmlrpc_server extends IXR_Server { return($this->error); } + set_current_user(0, $username); + if(!current_user_can("edit_posts")) { + return(new IXR_Error(401, __("Sorry, you can not edit posts on this blog."))); + } + do_action('xmlrpc_call', 'wp.getAuthors'); - return(get_users_of_blog()); + $authors = array(); + foreach( (array) get_users_of_blog() as $row ) { + $authors[] = array( + "user_id" => $row->user_id, + "user_login" => $row->user_login, + "display_name" => $row->display_name + ); + } + + return($authors); } /**