X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/11be8dc178e77d0b46189bbd8e33a216a9b90942..refs/tags/wordpress-2.9:/wp-admin/install.php?ds=sidebyside diff --git a/wp-admin/install.php b/wp-admin/install.php index de5b970d..8531a4b3 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -15,10 +15,10 @@ define('WP_INSTALLING', true); /** Load WordPress Bootstrap */ -require_once('../wp-load.php'); +require_once(dirname(dirname(__FILE__)) . '/wp-load.php'); /** Load WordPress Administration Upgrade API */ -require_once('./includes/upgrade.php'); +require_once(dirname(__FILE__) . '/includes/upgrade.php'); if (isset($_GET['step'])) $step = $_GET['step']; @@ -48,40 +48,56 @@ header( 'Content-Type: text/html; charset=utf-8' ); '.__('Already Installed').'

'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'

');} +function display_setup_form( $error = null ) { + // Ensure that Blogs appear in search engines by default + $blog_public = 1; + if ( isset($_POST) && !empty($_POST) ) { + $blog_public = isset($_POST['blog_public']); + } -switch($step) { - case 0: - case 1: // in case people are directly linking to this - display_header(); + if ( ! is_null( $error ) ) { ?> -

-

ReadMe documentation at your leisure. Otherwise, just fill in the information below and you\'ll be on your way to using the most extendable and powerful personal publishing platform in the world.'), '../readme.html'); ?>

- - -

-

- +

ERROR: %s'), $error); ?>

+
- + - - +

- +

+
-

+

+'.__('Already Installed').'

'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'

');} + +switch($step) { + case 0: + case 1: // in case people are directly linking to this + display_header(); +?> +

+

ReadMe documentation at your leisure. Otherwise, just fill in the information below and you’ll be on your way to using the most extendable and powerful personal publishing platform in the world.'), '../readme.html'); ?>

+ + +

+

+ + error) ) @@ -93,17 +109,21 @@ switch($step) { $admin_email = isset($_POST['admin_email']) ? stripslashes($_POST['admin_email']) : ''; $public = isset($_POST['blog_public']) ? (int) $_POST['blog_public'] : 0; // check e-mail address + $error = false; if (empty($admin_email)) { // TODO: poka-yoke - die('

'.__("ERROR: you must provide an e-mail address.").'

'); + display_setup_form( __('you must provide an e-mail address.') ); + $error = true; } else if (!is_email($admin_email)) { // TODO: poka-yoke - die('

'.__('ERROR: that isn’t a valid e-mail address. E-mail addresses look like: username@example.com').'

'); + display_setup_form( __('that isn’t a valid e-mail address. E-mail addresses look like: username@example.com') ); + $error = true; } - $wpdb->show_errors(); - $result = wp_install($weblog_title, 'admin', $admin_email, $public); - extract($result, EXTR_SKIP); + if ( $error === false ) { + $wpdb->show_errors(); + $result = wp_install($weblog_title, 'admin', $admin_email, $public); + extract($result, EXTR_SKIP); ?>

@@ -117,14 +137,17 @@ switch($step) { -
- '.__('Note that password carefully! It is a random password that was generated just for you.').'

'; ?> + '. $password .'
'; + } + echo '

'. $password_message .'

'; ?>