Index: wp-includes/class-wp-xmlrpc-server.php
===================================================================
--- wp-includes/class-wp-xmlrpc-server.php	(revision 19632)
+++ wp-includes/class-wp-xmlrpc-server.php	(working copy)
@@ -64,6 +64,7 @@
 			'wp.getMediaItem'		=> 'this:wp_getMediaItem',
 			'wp.getMediaLibrary'	=> 'this:wp_getMediaLibrary',
 			'wp.getPostFormats'     => 'this:wp_getPostFormats',
+			'wp.newUser'			=> 'this:wp_newUser',
 
 			// Blogger API
 			'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
@@ -1702,6 +1703,97 @@
 		return $formats;
 	}
 
+	/**
+	 * Create a new user
+	 *
+	 * @uses wp_insert_user()
+	 * @param array $args Method parameters. Contains:
+	 *  - int     $blog_id
+	 *  - string  $username
+	 *  - string  $password
+	 *  - array   $content_struct.
+	 *      The $content_struct must contain:
+	 *      - 'username'
+	 *      - 'password'
+	 *      - 'email'
+	 *      Also, it can optionally contain:
+	 *      - 'role'
+	 *      - 'first_name'
+	 *      - 'last_name'
+	 *      - 'website'
+	 *  - boolean $send_mail optional. Defaults to false
+	 * @return int user_id
+	 */
+	function wp_newUser( $args ) {
+		$this->escape($args);
+
+		$blog_id        = (int) $args[0];
+		$username       = $args[1];
+		$password       = $args[2];
+		$content_struct = $args[3];
+		$send_mail      = isset( $args[4] ) ? $args[4] : false;
+
+		if ( ! $user = $this->login( $username, $password ) )
+			return $this->error;
+
+		do_action( 'xmlrpc_call', 'wp.newUser' );
+
+		if ( ! current_user_can( 'create_users' ) )
+			return new IXR_Error( 401, __( 'You are not allowed to create users.' ) );
+
+		// this hold all the user data
+		$user_data = array();
+
+		if( empty ( $content_struct['username'] ) )
+			return new IXR_Error( 403, __( 'Username cannot be empty.' ) );
+		$user_data['user_login'] = $content_struct['username'];
+
+		if( empty ( $content_struct['password'] ) )
+			return new IXR_Error( 403, __( 'Password cannot be empty.' ) );
+		$user_data['user_pass'] = $content_struct['password'];
+
+		if( empty ( $content_struct['email'] ) )
+			return new IXR_Error( 403, __( 'Email cannot be empty.' ) );
+
+		if( ! is_email( $content_struct['email'] ) )
+			return new IXR_Error( 403, __( 'This email address is not valid.' ) );
+
+		if( email_exists( $content_struct['email'] ) )
+			return new IXR_Error( 403, __( 'This email address is already registered.' ) );
+
+		$user_data['user_email'] = $content_struct['email'];
+
+		if( isset ( $content_struct['role'] ) ) {
+			if ( get_role( $content_struct['role'] ) === null )
+				return new IXR_Error( 403, __( 'The role specified is not valid.' ) );
+
+			$user_data['role'] = $content_struct['role'];
+		}
+
+		if( isset ( $content_struct['first_name'] ) )
+			$user_data['first_name'] = $content_struct['first_name'];
+
+		if( isset ( $content_struct['last_name'] ) )
+			$user_data['last_name'] = $content_struct['last_name'];
+
+		if( isset ( $content_struct['url'] ) )
+			$user_data['user_url'] = $content_struct['url'];
+
+		$user_id = wp_insert_user( $user_data );
+
+		if ( is_wp_error( $user_id ) )
+			return new IXR_Error( 500, $user_id->get_error_message() );
+
+		if ( ! $user_id )
+			return new IXR_Error( 500, __( 'Sorry, the new user failed.' ) );
+
+		if ( $send_mail ) {
+			wp_new_user_notification( $user_id, $user_data['user_pass'] );
+		}
+
+		return $user_id;
+	}
+
 	/* Blogger API functions.
 	 * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/
 	 */
