X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7688c6ba71852cd89123b62b2d57683535e4702a..refs/tags/wordpress-2.9:/wp-admin/install.php diff --git a/wp-admin/install.php b/wp-admin/install.php index 6f4d7e3e..8531a4b3 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -1,19 +1,38 @@ wp-config.php file. I need this before we can get started. Need more help? We got it. You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.", "WordPress › Error"); -} -require_once('../wp-config.php'); -require_once('./includes/upgrade.php'); +/** Load WordPress Bootstrap */ +require_once(dirname(dirname(__FILE__)) . '/wp-load.php'); + +/** Load WordPress Administration Upgrade API */ +require_once(dirname(__FILE__) . '/includes/upgrade.php'); if (isset($_GET['step'])) $step = $_GET['step']; else $step = 0; -function display_header(){ + +/** + * Display install header. + * + * @since unknown + * @package WordPress + * @subpackage Installer + */ +function display_header() { header( 'Content-Type: text/html; charset=utf-8' ); ?> @@ -21,7 +40,7 @@ header( 'Content-Type: text/html; charset=utf-8' ); <?php _e('WordPress › Installation'); ?> - +

WordPress

@@ -29,6 +48,37 @@ header( 'Content-Type: text/html; charset=utf-8' ); +

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

+ +
+ + + + + + + + + + + + +

+
+

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

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

');} @@ -38,76 +88,69 @@ switch($step) { 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'); ?>

- +

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) ) wp_die($wpdb->error->get_error_message()); - display_header(); + display_header(); // Fill in the data we gathered - $weblog_title = stripslashes($_POST['weblog_title']); - $admin_email = stripslashes($_POST['admin_email']); - $public = (int) $_POST['blog_public']; + $weblog_title = isset($_POST['weblog_title']) ? stripslashes($_POST['weblog_title']) : ''; + $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); ?>

-

log in with the username "admin" and password "%2$s".'), '../wp-login.php', $password); ?>

-

Note that password carefully! It is a random password that was generated just for you.'); ?>

+

-
-
-
admin
-
-
-
-
wp-login.php
-
-

+ + + + + + + + + +
admin
'. $password .'
'; + } + echo '

'. $password_message .'

'; ?>
+ +

- - + - \ No newline at end of file +