Changeset 8202 for trunk/xmlrpc.php
- Timestamp:
- 06/26/2008 10:39:57 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xmlrpc.php
r8136 r8202 40 40 <homePageLink><?php bloginfo_rss('url') ?></homePageLink> 41 41 <apis> 42 <?php if ( get_option('enable_xmlrpc') ) :?>43 42 <api name="WordPress" blogID="1" preferred="true" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" /> 44 43 <api name="Movable Type" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" /> 45 44 <api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" /> 46 45 <api name="Blogger" blogID="1" preferred="false" apiLink="<?php bloginfo_rss('wpurl') ?>/xmlrpc.php" /> 47 <?php endif; if ( get_option('enable_app') ) :?>48 46 <api name="Atom" blogID="" preferred="false" apiLink="<?php echo apply_filters('atom_service_url', (get_bloginfo('url')."/wp-app.php/service"))?>" /> 49 <?php endif; ?>50 47 </apis> 51 48 </service> … … 112 109 113 110 function wp_xmlrpc_server() { 114 $ xmlrpc_methods = array(111 $this->methods = array( 115 112 // WordPress API 116 113 'wp.getUsersBlogs' => 'this:wp_getUsersBlogs', … … 168 165 'mt.supportedTextFilters' => 'this:mt_supportedTextFilters', 169 166 'mt.getTrackbackPings' => 'this:mt_getTrackbackPings', 170 'mt.publishPost' => 'this:mt_publishPost' 171 ); 172 173 $xmlrpc_functions = array ( 167 'mt.publishPost' => 'this:mt_publishPost', 168 174 169 // PingBack 175 170 'pingback.ping' => 'this:pingback_ping', … … 180 175 ); 181 176 182 if ( get_option('enable_xmlrpc') )183 {184 $this->methods = array_merge($xmlrpc_methods,$xmlrpc_functions);185 } else {186 $this->methods = $xmlrpc_functions;187 }188 189 177 $this->initialise_blog_option_info( ); 190 178 $this->methods = apply_filters('xmlrpc_methods', $this->methods); … … 203 191 204 192 function login_pass_ok($user_login, $user_pass) { 193 if ( !get_option( 'enable_xmlrpc' ) ) { 194 $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this blog. An admin user can enable them at %s'), admin_url('options-writing.php') ) ); 195 return false; 196 } 197 205 198 if (!user_pass_ok($user_login, $user_pass)) { 206 199 $this->error = new IXR_Error(403, __('Bad login/pass combination.')); … … 846 839 847 840 if( !$this->login_pass_ok( $username, $password ) ) { 848 return new IXR_Error( 403, __( 'Bad login/pass combination.' ) );841 return $this->error; 849 842 } 850 843 … … 874 867 875 868 if( !$this->login_pass_ok( $username, $password ) ) { 876 return new IXR_Error( 403, __( 'Bad login/pass combination.' ) );869 return $this->error; 877 870 } 878 871 … … 896 889 897 890 if( !$this->login_pass_ok( $username, $password ) ) { 898 return new IXR_Error( 403, __( 'Bad login/pass combination.' ) );891 return $this->error; 899 892 } 900 893 … … 917 910 918 911 if( !$this->login_pass_ok( $username, $password ) ) { 919 return new IXR_Error( 403, __( 'Bad login/pass combination.' ) );912 return $this->error; 920 913 } 921 914 … … 940 933 941 934 if( !$this->login_pass_ok( $username, $password ) ) 942 return new IXR_Error( 403, __( 'Bad login/pass combination.' ) );935 return $this->error; 943 936 944 937 $user = set_current_user( 0, $username ); … … 979 972 980 973 if( !$this->login_pass_ok( $username, $password ) ) 981 return new IXR_Error( 403, __( 'Bad login/pass combination.' ) );974 return $this->error; 982 975 983 976 $user = set_current_user( 0, $username );
Note: See TracChangeset
for help on using the changeset viewer.