Index: xmlrpc.php
===================================================================
--- xmlrpc.php	(revision 8102)
+++ xmlrpc.php	(working copy)
@@ -127,6 +127,8 @@
 			'wp.getPostStatusList'	=> 'this:wp_getPostStatusList',
 			'wp.getPageStatusList'	=> 'this:wp_getPageStatusList',
 			'wp.getPageTemplates'	=> 'this:wp_getPageTemplates',
+			'wp.getOptions'			=> 'this:wp_getOptions',
+			'wp.setOptions'			=> 'this:wp_setOptions',
 
 			// Blogger API
 			'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
@@ -171,6 +173,8 @@
 			'demo.sayHello' => 'this:sayHello',
 			'demo.addTwoNumbers' => 'this:addTwoNumbers'
 		);
+
+		$this->update_blog_option_info( );
 		$this->methods = apply_filters('xmlrpc_methods', $this->methods);
 		$this->IXR_Server($this->methods);
 	}
@@ -255,6 +259,58 @@
 		}
 	}
 
+	function update_blog_option_info( ) {
+		global $wp_version;
+
+		$this->blog_options = array(
+			// Read only options
+			'software_name'		=> array(
+				'desc'			=> __( 'Software Name' ),
+				'readonly'		=> true,
+				'value'			=> 'WordPress'
+			),
+			'software_version'	=> array(
+				'desc'			=> __( 'Software Version' ),
+				'readonly'		=> true,
+				'value'			=> $wp_version
+			),
+			'blog_url'			=> array(
+				'desc'			=> __( 'Blog URL' ),
+				'readonly'		=> true,
+				'value'			=> get_option( 'siteurl' )
+			),
+
+			// Updatable options
+			'time_zone'			=> array(
+				'desc'			=> __( 'Time Zone' ),
+				'readonly'		=> false,
+				'value'			=> get_option( 'gmt_offset' )
+			),
+			'blog_title'		=> array(
+				'desc'			=> __( 'Blog Title' ),
+				'readonly'		=> false,
+				'value'			=> get_option( 'blogname' )
+			),
+			'blog_tagline'		=> array(
+				'desc'			=> __( 'Blog Tagline' ),
+				'readonly'		=> false,
+				'value'			=> get_option( 'blogdescription' )
+			),
+			'date_format'		=> array(
+				'desc'			=> __( 'Date Format' ),
+				'readonly'		=> false,
+				'value'			=> get_option( 'date_format' )
+			),
+			'time_format'		=> array(
+				'desc'			=> __( 'Time Format' ),
+				'readonly'		=> false,
+				'value'			=> get_option( 'time_format' )
+			)
+		);
+
+		$this->blog_options = apply_filters( 'xmlrpc_blog_options', $this->blog_options );
+	}
+
 	/**
 	 * WordPress XML-RPC API
 	 * wp_getUsersBlogs
@@ -862,7 +918,85 @@
 		return $templates;
 	}
 
+	function wp_getOptions( $args ) {
+		$this->escape( $args );
 
+		$blog_id	= (int) $args[0];
+		$username	= $args[1];
+		$password	= $args[2];
+		$options	= (array) $args[3];
+
+		if( !$this->login_pass_ok( $username, $password ) )
+			return new IXR_Error( 403, __( 'Bad login/pass combination.' ) );
+
+		$user = set_current_user( 0, $username );
+
+		// If no specific options where asked for, return all of them
+		if( count( $options ) == 0 )
+			return $this->blog_options;
+
+		$data = array( );
+		foreach( $options as $option ) {
+			if( array_key_exists( $option, $this->blog_options ) )
+				$data[$option] = $this->blog_options[$option];
+		}
+
+		return $data;
+	}
+
+	function wp_setOptions( $args ) {
+		$this->escape( $args );
+
+		$blog_id	= (int) $args[0];
+		$username	= $args[1];
+		$password	= $args[2];
+		$options	= (array) $args[3];
+
+		if( !$this->login_pass_ok( $username, $password ) )
+			return new IXR_Error( 403, __( 'Bad login/pass combination.' ) );
+
+		$user = set_current_user( 0, $username );
+		if( !current_user_can( 'manage_options' ) )
+			return new IXR_Error( 403, __( 'You are not allowed to update options.' ) );
+
+		foreach( $options as $o_name => $o_value ) {
+			if( empty( $o_value ) )
+				continue;
+
+			if( !array_key_exists( $o_name, $this->blog_options ) )
+				continue;
+
+			if( $this->blog_options[$o_name]['readonly'] == true )
+				continue;
+
+			switch( $o_name ) {
+				case 'blog_title':
+					update_option( 'blogname', $o_value );
+					break;
+				case 'blog_tagline':
+					update_option( 'blogdescription', $o_value );
+					break;
+				case 'time_zone':
+					update_option( 'gmt_offset', $o_value );
+
+				// date_format, time_format
+				default:
+					update_option( $o_name, $o_value );
+					break;
+			}
+		}
+
+		$this->update_blog_option_info( );
+
+		$data = array( );
+		foreach( $options as $o_name => $o_value ) {
+			if( array_key_exists( $o_name, $this->blog_options ) )
+				$data[$o_name] = $this->blog_options[$o_name];
+		}
+
+		return $data;
+	}
+
 	/* Blogger API functions
 	 * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/
 	 */
