Ticket #1088: login_noun_to_username_switch.patch
File login_noun_to_username_switch.patch, 10.9 KB (added by , 20 years ago) |
---|
-
wp-login.php
66 66 <form name="lostpass" action="wp-login.php" method="post" id="lostpass"> 67 67 <p> 68 68 <input type="hidden" name="action" value="retrievepassword" /> 69 <label><?php _e(' Login') ?>:<br />69 <label><?php _e('Username') ?>:<br /> 70 70 <input type="text" name="user_login" id="user_login" value="" size="20" tabindex="1" /></label></p> 71 71 <p><label><?php _e('E-mail') ?>:<br /> 72 72 <input type="text" name="email" id="email" value="" size="25" tabindex="2" /></label><br /> … … 101 101 $key = substr( md5( uniqid( microtime() ) ), 0, 50); 102 102 // now insert the new pass md5'd into the db 103 103 $wpdb->query("UPDATE $wpdb->users SET user_activation_key = '$key' WHERE user_login = '$user_login'"); 104 $message .= __("Someone has asked to reset a password for the loginthis site\n\n " . get_option('siteurl') ) . "\n\n";105 $message .= __(' Login') . ": $user_login\r\n\r\n";104 $message .= __("Someone has asked to reset a password for the username this site\n\n " . get_option('siteurl') ) . "\n\n"; 105 $message .= __('Username') . ": $user_login\r\n\r\n"; 106 106 $message .= __("To reset your password visit the following address, otherwise just ignore this email and nothing will happen.\n\n"); 107 107 $message .= get_settings('siteurl') . "/wp-login.php?action=resetpass&key=$key"; 108 108 … … 132 132 133 133 $new_pass = substr( md5( uniqid( microtime() ) ), 0, 7); 134 134 $wpdb->query("UPDATE $wpdb->users SET user_pass = MD5('$new_pass'), user_activation_key = '' WHERE user_login = '$user->user_login'"); 135 $message = __(' Login') . ": $user->user_login\r\n";135 $message = __('Username') . ": $user->user_login\r\n"; 136 136 $message .= __('Password') . ": $new_pass\r\n"; 137 137 $message .= get_settings('siteurl') . '/wp-login.php'; 138 138 … … 222 222 ?> 223 223 224 224 <form name="loginform" id="loginform" action="wp-login.php" method="post"> 225 <p><label><?php _e(' Login') ?>:<br /><input type="text" name="log" id="log" value="" size="20" tabindex="1" /></label></p>225 <p><label><?php _e('Username') ?>:<br /><input type="text" name="log" id="log" value="" size="20" tabindex="1" /></label></p> 226 226 <p><label><?php _e('Password') ?>:<br /> <input type="password" name="pwd" id="pwd" value="" size="20" tabindex="2" /></label></p> 227 227 <p class="submit"> 228 228 <input type="submit" name="submit" id="submit" value="<?php _e('Login'); ?> »" tabindex="3" /> … … 244 244 245 245 break; 246 246 } // end action switch 247 ?> 248 No newline at end of file 247 ?> -
wp-includes/functions.php
1678 1678 $login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'"); 1679 1679 1680 1680 if (!$login) { 1681 $error = __('<strong>Error</strong>: Wrong login.');1681 $error = __('<strong>Error</strong>: Wrong username.'); 1682 1682 return false; 1683 1683 } else { 1684 1684 // If the password is already_md5, it has been double hashed. -
wp-register.php
28 28 $user_login = $_POST['user_login']; 29 29 $user_email = $_POST['user_email']; 30 30 31 /* checking loginhas been typed */31 /* checking that username has been typed */ 32 32 if ($user_login == '') { 33 die (__('<strong>ERROR</strong>: Please enter a login.'));33 die (__('<strong>ERROR</strong>: Please enter a username.')); 34 34 } 35 35 36 36 /* checking e-mail address */ … … 40 40 die (__('<strong>ERROR</strong>: The email address isn’t correct.')); 41 41 } 42 42 43 /* checking the loginisn't already used by another user */43 /* checking the username isn't already used by another user */ 44 44 $result = $wpdb->get_results("SELECT user_login FROM $wpdb->users WHERE user_login = '$user_login'"); 45 45 if (count($result) >= 1) { 46 die (__('<strong>ERROR</strong>: This loginis already registered, please choose another one.'));46 die (__('<strong>ERROR</strong>: This username is already registered, please choose another one.')); 47 47 } 48 48 49 49 $user_ip = $_SERVER['REMOTE_ADDR'] ; … … 73 73 $stars .= '*'; 74 74 } 75 75 76 $message = __(' Login') . ": $user_login\r\n";76 $message = __('Username') . ": $user_login\r\n"; 77 77 $message .= __('Password') . ": $password\r\n"; 78 78 $message .= get_settings('siteurl') . '/wp-login.php'; 79 79 80 wp_mail($user_email, sprintf(__("[%s] Your login information"), get_settings('blogname')), $message);80 wp_mail($user_email, sprintf(__("[%s] Your username and password"), get_settings('blogname')), $message); 81 81 82 $message = sprintf(__("New user registration on your blog %1\$s:\n\n Login: %2\$s \n\nE-mail: %3\$s"), get_settings('blogname'), $user_login, $user_email);82 $message = sprintf(__("New user registration on your blog %1\$s:\n\nUsername: %2\$s \n\nE-mail: %3\$s"), get_settings('blogname'), $user_login, $user_email); 83 83 84 84 @wp_mail(get_settings('admin_email'), sprintf(__('[%s] New User Registration'), get_settings('blogname')), $message); 85 85 … … 100 100 101 101 <div id="login"> 102 102 <h2><?php _e('Registration Complete') ?></h2> 103 <p><?php _e(' Login:') ?> <strong><?php echo $user_login; ?></strong><br />103 <p><?php _e('Username:') ?> <strong><?php echo $user_login; ?></strong><br /> 104 104 <?php _e('Password:') ?> <strong>emailed to you</strong><br /> 105 105 <?php _e('E-mail:') ?> <strong><?php echo $user_email; ?></strong></p> 106 106 <p class="submit"><a href="wp-login.php"><?php _e('Login'); ?> »</a></p> … … 160 160 161 161 <form method="post" action="wp-register.php" id="registerform"> 162 162 <p><input type="hidden" name="action" value="register" /> 163 <label for="user_login"><?php _e(' Login:') ?></label><br /> <input type="text" name="user_login" id="user_login" size="20" maxlength="20" /><br /></p>163 <label for="user_login"><?php _e('Username:') ?></label><br /> <input type="text" name="user_login" id="user_login" size="20" maxlength="20" /><br /></p> 164 164 <p><label for="user_email"><?php _e('E-mail') ?></label>:<br /> <input type="text" name="user_email" id="user_email" size="25" maxlength="100" /></p> 165 165 <p>A password will be emailed to you.</p> 166 166 <p class="submit"><input type="submit" value="<?php _e('Register') ?> »" id="submit" name="submit" /></p> … … 178 178 179 179 break; 180 180 } 181 ?> 182 No newline at end of file 181 ?> -
wp-admin/users.php
32 32 $user_lastname = wp_specialchars($_POST['lastname']); 33 33 $user_uri = wp_specialchars($_POST['uri']); 34 34 35 /* checking loginhas been typed */35 /* checking that username has been typed */ 36 36 if ($user_login == '') 37 die (__('<strong>ERROR</strong>: Please enter a login.'));37 die (__('<strong>ERROR</strong>: Please enter a username.')); 38 38 39 39 /* checking the password has been typed twice */ 40 40 do_action('check_passwords', array($user_login, &$pass1, &$pass2)); … … 47 47 48 48 $user_nickname = $user_login; 49 49 50 /* checking th e loginisn't already used by another user */50 /* checking that the username isn't already used by another user */ 51 51 $loginthere = $wpdb->get_var("SELECT user_login FROM $wpdb->users WHERE user_login = '$user_login'"); 52 52 if ($loginthere) 53 die (__('<strong>ERROR</strong>: This loginis already registered, please choose another one.'));53 die (__('<strong>ERROR</strong>: This username is already registered, please choose another one.')); 54 54 55 55 /* checking e-mail address */ 56 56 if (empty($_POST["email"])) { … … 82 82 83 83 $user_login = stripslashes($user_login); 84 84 $message = 'New user registration on your blog ' . get_settings('blogname') . ":\r\n\r\n"; 85 $message .= " Login: $user_login\r\n\r\nE-mail: $user_email";85 $message .= "Username: $user_login\r\n\r\nE-mail: $user_email"; 86 86 87 87 @wp_mail(get_settings('admin_email'), '[' . get_settings('blogname') . '] New User Registration', $message); 88 88 header('Location: users.php'); -
wp-admin/profile.php
30 30 31 31 /* checking the nickname has been typed */ 32 32 if (empty($_POST["newuser_nickname"])) { 33 die (__("<strong>ERROR</strong>: please enter your nickname (can be the same as your login)"));33 die (__("<strong>ERROR</strong>: please enter your nickname (can be the same as your username)")); 34 34 return false; 35 35 } 36 36 … … 144 144 145 145 <table width="99%" border="0" cellspacing="2" cellpadding="3" class="editform"> 146 146 <tr> 147 <th width="33%" scope="row"><?php _e(' Login:') ?></th>147 <th width="33%" scope="row"><?php _e('Username:') ?></th> 148 148 <td width="67%"><?php echo $profiledata->user_login; ?></td> 149 149 </tr> 150 150 <tr> -
wp-admin/user-edit.php
30 30 31 31 /* checking the nickname has been typed */ 32 32 if (empty($_POST["new_nickname"])) { 33 die (__("<strong>ERROR</strong>: please enter your nickname (can be the same as your login)"));33 die (__("<strong>ERROR</strong>: please enter your nickname (can be the same as your username)")); 34 34 return false; 35 35 } 36 36 … … 99 99 <form name="edituser" id="edituser" action="user-edit.php" method="post"> 100 100 <table width="99%" border="0" cellspacing="2" cellpadding="3"> 101 101 <tr> 102 <th width="33%" scope="row"><?php _e(' Login:') ?></th>102 <th width="33%" scope="row"><?php _e('Username:') ?></th> 103 103 <td width="73%"><input type="text" name="new_user_login" id="new_user_login" value="<?php echo $edituser->user_login; ?>" /></td> 104 104 </tr> 105 105 <tr> … … 209 209 } 210 210 211 211 include('admin-footer.php'); 212 ?> 213 No newline at end of file 212 ?> -
wp-admin/install.php
193 193 194 194 <p><em><?php _e('Finished!'); ?></em></p> 195 195 196 <p><?php printf(__('Now you can <a href="%1$s">log in</a> with the <strong> login</strong> "<code>admin</code>" and <strong>password</strong> "<code>%2$s</code>".'), '../wp-login.php', $random_password); ?></p>196 <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', $random_password); ?></p> 197 197 <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:'); ?> 198 198 </p> 199 199 <dl> 200 <dt><?php _e(' Login'); ?></dt>200 <dt><?php _e('Username'); ?></dt> 201 201 <dd><code>admin</code></dd> 202 202 <dt><?php _e('Password'); ?></dt> 203 203 <dd><code><?php echo $random_password; ?></code></dd>