Allow enabling of remote publishing at install time. See #7157.

git-svn-id: http://svn.automattic.com/wordpress/trunk@8139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2008-06-20 16:35:45 +00:00
parent a9e944fee6
commit 2b0d5a7cab
2 changed files with 10 additions and 2 deletions

View File

@ -6,7 +6,7 @@ require_once(ABSPATH . 'wp-admin/includes/admin.php');
require_once(ABSPATH . 'wp-admin/includes/schema.php');
if ( !function_exists('wp_install') ) :
function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='') {
function wp_install($blog_title, $user_name, $user_email, $public, $remote) {
global $wp_rewrite;
wp_check_mysql_version();
@ -18,6 +18,9 @@ function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='
update_option('blogname', $blog_title);
update_option('admin_email', $user_email);
update_option('blog_public', $public);
update_option('enable_app',$remote);
update_option('enable_xmlrpc',$remote);
$schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';
if ( defined('WP_SITEURL') && '' != WP_SITEURL )

View File

@ -53,6 +53,10 @@ switch($step) {
<tr>
<td colspan="2"><label><input type="checkbox" name="blog_public" value="1" checked="checked" /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td>
</tr>
<tr>
<td colspan="2"><label><input type="checkbox" name="enable_remotepublishing" value="0" /> <?php _e('Enable remote publishing using the WordPress, Movable Type, MetaWeblog, Blogger and Atom publishing protocols for my blog.'); ?></label></td>
</tr>
</table>
</table>
<input type="submit" name="Submit" value="<?php _e('Install WordPress'); ?>" class="button" />
</form>
@ -68,6 +72,7 @@ switch($step) {
$weblog_title = stripslashes($_POST['weblog_title']);
$admin_email = stripslashes($_POST['admin_email']);
$public = (int) $_POST['blog_public'];
$remote = (int) $_POST['enable_remotepublishing'];
// check e-mail address
if (empty($admin_email)) {
// TODO: poka-yoke
@ -78,7 +83,7 @@ switch($step) {
}
$wpdb->show_errors();
$result = wp_install($weblog_title, 'admin', $admin_email, $public);
$result = wp_install($weblog_title, 'admin', $admin_email, $public, $remote);
extract($result, EXTR_SKIP);
?>