Changeset 1132

Show
Ignore:
Timestamp:
10/26/07 11:09:56 (1 year ago)
Author:
donncha
Message:

Remove "disable xml-rpc" feature, it's going in a plugin.
Added wpmu_options and update_wpmu_options hooks to add options to wpmu-options.php

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/index-install.php

    r1114 r1132  
    369369        $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, 'admin_user_id', '1')" ); 
    370370        $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, 'registration', 'none')" ); 
    371         $wpdb->query( "INSERT INTO ".$wpdb->sitemeta." (meta_id, site_id, meta_key, meta_value) VALUES (NULL, 1, 'xmlrpc_active', 'yes')" ); 
    372371        $wpdb->query( "INSERT INTO ".$wpdb->site." ( id, domain, path ) VALUES ( NULL, '$domain', '$base' )" ); 
    373372        $wpdb->query( "INSERT INTO " . $wpdb->sitecategories . " ( cat_ID, cat_name, category_nicename, last_updated ) VALUES (1, 'Uncategorized', 'uncategorized', NOW())" ); 
  • trunk/wp-admin/wpmu-edit.php

    r1122 r1132  
    3737                update_site_option( "illegal_names", $names ); 
    3838                update_site_option( "registration", $_POST['registration'] ); 
    39                 update_site_option( "xmlrpc_active", $_POST[ 'xmlrpc_active' ] );  
    4039                update_site_option( "registrationnotification", $_POST['registrationnotification'] ); 
    4140                 
     
    7776                        update_site_option( 'site_admins' , $site_admins ); 
    7877                } 
     78 
     79                // Update more options here 
     80                do_action( 'update_wpmu_options' ); 
    7981 
    8082                wp_redirect( add_query_arg( "updated", "true", $_SERVER['HTTP_REFERER'] ) ); 
  • trunk/wp-admin/wpmu-options.php

    r1121 r1132  
    7070                                        </td>  
    7171                                </tr>  
    72                                  
    73                                 <tr valign="top">   
    74                                         <th scope="row"><?php _e('Enable posting by XMLRPC') ?></th>   
    75                                         <?php  
    76                                         if( !get_site_option('xmlrpc_active') )  
    77                                                 update_site_option( 'xmlrpc_active', 'yes' );  
    78                                         ?>  
    79                                         <td> 
    80                                                 <input name="xmlrpc_active" type="radio" id="xmlrpc_active1" value='yes' <?php echo get_site_option('xmlrpc_active') == 'yes' ? 'checked="checked"' : ''; ?> /> <?php _e('Yes'); ?><br />  
    81                                                 <input name="xmlrpc_active" type="radio" id="xmlrpc_active2" value='no' <?php echo get_site_option('xmlrpc_active') == 'no' ? 'checked="checked"' : ''; ?> /> <?php _e('No'); ?><br />  
    82                                                 <?php _e('This is an advanced technique for making posts to blogs. It is used by <a href="http://codex.wordpress.org/Weblog_Client">blog clients</a> like Ecto, Flock and Microsoft Live Writer and by Flickr to post pictures to blogs. Unfortunately it is also extensively used by spammers. <em>Disabled by Default</em>') ?> 
    83                                         </td>   
    84                                 </tr>   
    8572                                 
    8673                                <tr valign="top">  
     
    205192                        </table> 
    206193                </fieldset> 
     194 
     195                <?php 
     196                // Add more options here 
     197                do_action( 'wpmu_options' ); 
     198                ?> 
    207199                 
    208200                <p class="submit">  
  • trunk/wp-includes/wpmu-functions.php

    r1118 r1132  
    18691869} 
    18701870add_filter( 'allowed_redirect_hosts', 'redirect_this_site' ); 
    1871  
    1872 function is_xmlrpc_active() { 
    1873         global $HTTP_RAW_POST_DATA; 
    1874         if ($HTTP_RAW_POST_DATA) 
    1875                 $data = $HTTP_RAW_POST_DATA; 
    1876  
    1877         // add this to a blog's options table to enable xmlrpc on that blog 
    1878         if( get_option( 'xmlrpc_active' ) == 'yes' ) 
    1879                 return true; 
    1880  
    1881         // kill everything but pingbacks if xmlrpc is disabled 
    1882         if( defined( 'XMLRPC_REQUEST' ) && strpos( $data, '<methodName>pingback.ping</methodName>' ) === false && (get_option( 'xmlrpc_active' ) == 'no' || get_site_option( 'xmlrpc_active' ) != 'yes' ) ) 
    1883                 die(); 
    1884 } 
    1885 add_action( 'init', 'is_xmlrpc_active' ); 
    18861871?>