Ticket #5477: 5477.r10258.diff
File 5477.r10258.diff, 5.3 KB (added by , 15 years ago) |
---|
-
install.php
48 48 <?php 49 49 }//end function display_header(); 50 50 51 // Let's check to make sure WP isn't already installed. 52 if ( is_blog_installed() ) {display_header(); die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>');} 53 54 switch($step) { 55 case 0: 56 case 1: // in case people are directly linking to this 57 display_header(); 51 function display_setup_form( $error = null ) { 52 if ( ! is_null( $error ) ) { 58 53 ?> 59 <h1><?php _e('Welcome'); ?></h1> 60 <p><?php printf(__('Welcome to the famous five minute WordPress installation process! You may want to browse the <a href="%s">ReadMe documentation</a> 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'); ?></p> 61 <!--<h2 class="step"><a href="install.php?step=1"><?php _e('First Step'); ?></a></h2>--> 62 63 <h1><?php _e('Information needed'); ?></h1> 64 <p><?php _e("Please provide the following information. Don't worry, you can always change these settings later."); ?></p> 65 54 <p><strong><?php _e('ERROR'); ?></strong>: <?php echo $error; ?></p> 55 <?php } ?> 66 56 <form id="setup" method="post" action="install.php?step=2"> 67 57 <table class="form-table"> 68 58 <tr> 69 59 <th scope="row"><label for="weblog_title"><?php _e('Blog Title'); ?></label></th> 70 <td><input name="weblog_title" type="text" id="weblog_title" size="25" /></td>60 <td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php echo ( isset($_POST['weblog_title']) ? $_POST['weblog_title'] : '' ); ?>" /></td> 71 61 </tr> 72 62 <tr> 73 63 <th scope="row"><label for="admin_email"><?php _e('Your E-mail'); ?></label></th> 74 <td><input name="admin_email" type="text" id="admin_email" size="25" /><br />64 <td><input name="admin_email" type="text" id="admin_email" size="25" value="<?php echo ( isset($_POST['admin_email']) ? $_POST['admin_email'] : '' ); ?>" /><br /> 75 65 <?php _e('Double-check your email address before continuing.'); ?> 76 66 </tr> 77 67 <tr> 78 <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>68 <td colspan="2"><label><input type="checkbox" name="blog_public" value="1"<?php if( isset($_POST) && ! empty($_POST) && isset( $_POST['blog_public'] ) ) : ?> checked="checked"<?php endif; ?> /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td> 79 69 </tr> 80 70 </table> 81 71 <p class="step"><input type="submit" name="Submit" value="<?php _e('Install WordPress'); ?>" class="button" /></p> 82 72 </form> 73 <?php 74 } 83 75 76 // Let's check to make sure WP isn't already installed. 77 if ( is_blog_installed() ) {display_header(); die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>');} 78 79 switch($step) { 80 case 0: 81 case 1: // in case people are directly linking to this 82 display_header(); 83 ?> 84 <h1><?php _e('Welcome'); ?></h1> 85 <p><?php printf(__('Welcome to the famous five minute WordPress installation process! You may want to browse the <a href="%s">ReadMe documentation</a> 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'); ?></p> 86 <!--<h2 class="step"><a href="install.php?step=1"><?php _e('First Step'); ?></a></h2>--> 87 88 <h1><?php _e('Information needed'); ?></h1> 89 <p><?php _e("Please provide the following information. Don't worry, you can always change these settings later."); ?></p> 90 91 92 84 93 <?php 94 display_setup_form(); 85 95 break; 86 96 case 2: 87 97 if ( !empty($wpdb->error) ) … … 93 103 $admin_email = isset($_POST['admin_email']) ? stripslashes($_POST['admin_email']) : ''; 94 104 $public = isset($_POST['blog_public']) ? (int) $_POST['blog_public'] : 0; 95 105 // check e-mail address 106 $error = false; 96 107 if (empty($admin_email)) { 97 108 // TODO: poka-yoke 98 die('<p>'.__("<strong>ERROR</strong>: you must provide an e-mail address.").'</p>'); 109 display_setup_form( __('you must provide an e-mail address.') ); 110 $error = true; 99 111 } else if (!is_email($admin_email)) { 100 112 // TODO: poka-yoke 101 die('<p>'.__('<strong>ERROR</strong>: that isn’t a valid e-mail address. E-mail addresses look like: <code>username@example.com</code>').'</p>'); 113 display_setup_form( __('that isn’t a valid e-mail address. E-mail addresses look like: <code>username@example.com</code>') ); 114 $error = true; 102 115 } 103 116 104 $wpdb->show_errors(); 105 $result = wp_install($weblog_title, 'admin', $admin_email, $public); 106 extract($result, EXTR_SKIP); 117 if ( $error === false ) { 118 $wpdb->show_errors(); 119 $result = wp_install($weblog_title, 'admin', $admin_email, $public); 120 extract($result, EXTR_SKIP); 107 121 ?> 108 122 109 123 <h1><?php _e('Success!'); ?></h1> … … 125 139 <p class="step"><a href="../wp-login.php" class="button"><?php _e('Log In'); ?></a></p> 126 140 127 141 <?php 142 } 128 143 break; 129 144 } 130 145 ?>