# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /var/www/GSoC/wordtrunk/wp-includes
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: class-wp-xmlrpc-server.php
--- class-wp-xmlrpc-server.php Base (BASE)
+++ class-wp-xmlrpc-server.php Locally Modified (Based On LOCAL)
@@ -64,6 +64,7 @@
 			'wp.getMediaItem'		=> 'this:wp_getMediaItem',
 			'wp.getMediaLibrary'	=> 'this:wp_getMediaLibrary',
 			'wp.getPostFormats'     => 'this:wp_getPostFormats',
+                        'wp.deleteUser'         => 'this:wp_deleteUser',
 
 			// Blogger API
 			'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
@@ -1702,6 +1703,63 @@
 		return $formats;
 	}
 
+        /**
+         * Delete a  user
+         *
+         * @uses wp_delete_user()
+         * @param array $args Method parameters. Contains:
+         *  - int     $blog_id
+         *  - string  $username
+         *  - string  $password
+         *  - array   $user_ids
+         * @return array user_ids
+         */
+        function wp_deleteUser( $args ) {
+
+		$this->escape( $args );
+
+                $blog_ID    = (int) $args[0];
+                $username   = $args[1];
+                $password   = $args[2];
+                $user_IDs   = $args[3]; // can be an array of user ID's
+
+		if ( ! $user = $this->login( $username, $password ) )
+			return $this->error;
+
+                if( ! current_user_can( 'delete_users' ) )
+                                return new IXR_Error( 401, __( 'You are not allowed to delete users.' ) );
+
+                // if only a single ID is given convert it to an array
+                if( ! is_array( $user_IDs ) )
+                    $user_IDs = array( (int)$user_IDs );
+
+                foreach( $user_IDs as $user_ID ) {
+
+                        $user_ID = (int) $user_ID;
+
+                        if( ! get_userdata( $user_ID ) )
+                                return new IXR_Error(404, __('Sorry, one of the given user does not exist.'));
+                        
+                        if( $user->ID == $user_ID )
+                                return new IXR_Error( 401, __( 'You cannot delete yourself.' ) );
+
+                }
+
+                // this holds all the id of deleted users and return it
+                $deleted_users = array();
+
+                foreach( $user_IDs as $user_ID ) {
+
+                        $result = wp_delete_user( $user_ID );
+                        if ( $result )
+                                $deleted_users[] = $user_ID;
+
+                }
+
+                return $deleted_users;
+
+        }
+        
 	/* Blogger API functions.
 	 * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/
 	 */
