root/branches/2.1/wp-admin/install.php

Revision 4766, 4.8 kB (checked in by ryan, 2 years ago)

Don't translate admin user. Leave it fixed. Props nbachiyski. fixes #3589

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php
2 define('WP_INSTALLING', true);
3 if (!file_exists('../wp-config.php')) {
4   require_once('../wp-includes/functions.php');
5   wp_die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can <a href='setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.", "WordPress &rsaquo; Error");
6 }
7
8 require_once('../wp-config.php');
9 require_once('./upgrade-functions.php');
10
11 if (isset($_GET['step']))
12     $step = $_GET['step'];
13 else
14     $step = 0;
15 header( 'Content-Type: text/html; charset=utf-8' );
16 ?>
17 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
18 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
19 <head>
20     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
21     <title><?php _e('WordPress &rsaquo; Installation'); ?></title>
22     <link rel="stylesheet" href="install.css?version=<?php bloginfo('version'); ?>" type="text/css" />
23     <?php if ( ('rtl' == $wp_locale->text_direction) ) : ?>
24     <link rel="stylesheet" href="install-rtl.css?version=<?php bloginfo('version'); ?>" type="text/css" />
25     <?php endif; ?>
26 </head>
27 <body>
28 <h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
29 <?php
30 // Let's check to make sure WP isn't already installed.
31 if ( is_blog_installed() ) 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>');
32
33 switch($step) {
34     case 0:
35 ?>
36 <p><?php printf(__('Welcome to WordPress installation. We&#8217;re now going to go through a few steps to get you up and running with the latest in personal publishing platforms. You may want to peruse the <a href="%s">ReadMe documentation</a> at your leisure.'), '../readme.html'); ?></p>
37 <h2 class="step"><a href="install.php?step=1"><?php _e('First Step &raquo;'); ?></a></h2>
38 <?php
39         break;
40     case 1:
41 ?>
42 <h1><?php _e('First Step'); ?></h1>
43 <p><?php _e("Before we begin we need a little bit of information. Don't worry, you can always change these later."); ?></p>
44
45 <form id="setup" method="post" action="install.php?step=2">
46     <table width="100%">
47         <tr>
48             <th width="33%"><?php _e('Weblog title:'); ?></th>
49             <td><input name="weblog_title" type="text" id="weblog_title" size="25" /></td>
50         </tr>
51         <tr>
52             <th><?php _e('Your e-mail:'); ?></th>
53             <td><input name="admin_email" type="text" id="admin_email" size="25" /></td>
54         </tr>
55         <tr>
56             <th scope="row"  valign="top"> <?php __('Privacy:'); ?></th>
57             <td><label><input type="checkbox" name="blog_public" value="1" checked="checked" /> <?php _e('I would like my blog to appear in search engines like Google and Technorati.'); ?></label></td>
58         </tr>
59     </table>
60     <p><em><?php _e('Double-check that email address before continuing.'); ?></em></p>
61     <h2 class="step"><input type="submit" name="Submit" value="<?php _e('Continue to Second Step &raquo;'); ?>" /></h2>
62 </form>
63
64 <?php
65         break;
66     case 2:
67         // Fill in the data we gathered
68         $weblog_title = stripslashes($_POST['weblog_title']);
69         $admin_email = stripslashes($_POST['admin_email']);
70         $public = (int) $_POST['blog_public'];
71         // check e-mail address
72         if (empty($admin_email)) {
73             die(__("<strong>ERROR</strong>: please type your e-mail address"));
74         } else if (!is_email($admin_email)) {
75             die(__("<strong>ERROR</strong>: the e-mail address isn't correct"));
76         }
77
78 ?>
79 <h1><?php _e('Second Step'); ?></h1>
80 <p><?php _e('Now we&#8217;re going to create the database tables and fill them with some default data.'); ?></p>
81
82
83 <?php
84     $result = wp_install($weblog_title, 'admin', $admin_email, $public);
85     extract($result);
86 ?>
87
88 <p><em><?php _e('Finished!'); ?></em></p>
89
90 <p><?php printf(__('Now you can <a href="%1$s">log in</a> with the <strong>username</strong> "<code>admin</code>" and <strong>password</strong> "<code>%2$s</code>".'), '../wp-login.php', $password); ?></p>
91 <p><?php _e('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you. If you lose it, you will have to delete the tables from the database yourself, and re-install WordPress. So to review:'); ?></p>
92
93 <dl>
94     <dt><?php _e('Username'); ?></dt>
95         <dd><code>admin</code></dd>
96     <dt><?php _e('Password'); ?></dt>
97         <dd><code><?php echo $password; ?></code></dd>
98     <dt><?php _e('Login address'); ?></dt>
99         <dd><a href="../wp-login.php">wp-login.php</a></dd>
100 </dl>
101 <p><?php _e('Were you expecting more steps? Sorry to disappoint. All done! :)'); ?></p>
102
103 <?php
104         break;
105 }
106 ?>
107
108 <p id="footer"><?php _e('<a href="http://wordpress.org/">WordPress</a>, personal publishing platform.'); ?></p>
109 </body>
110 </html>
Note: See TracBrowser for help on using the browser.