Make WordPress Core

Ticket #1088: login_noun_to_username_switch.patch

File login_noun_to_username_switch.patch, 10.9 KB (added by Albert, 20 years ago)
  • wp-login.php

     
    6666<form name="lostpass" action="wp-login.php" method="post" id="lostpass">
    6767<p>
    6868<input type="hidden" name="action" value="retrievepassword" />
    69 <label><?php _e('Login') ?>:<br />
     69<label><?php _e('Username') ?>:<br />
    7070<input type="text" name="user_login" id="user_login" value="" size="20" tabindex="1" /></label></p>
    7171<p><label><?php _e('E-mail') ?>:<br />
    7272<input type="text" name="email" id="email" value="" size="25" tabindex="2" /></label><br />
     
    101101        $key = substr( md5( uniqid( microtime() ) ), 0, 50);
    102102        // now insert the new pass md5'd into the db
    103103        $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 login this 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";
    106106        $message .= __("To reset your password visit the following address, otherwise just ignore this email and nothing will happen.\n\n");
    107107        $message .= get_settings('siteurl') . "/wp-login.php?action=resetpass&key=$key";
    108108
     
    132132
    133133        $new_pass = substr( md5( uniqid( microtime() ) ), 0, 7);
    134134        $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";
    136136        $message .= __('Password') . ": $new_pass\r\n";
    137137        $message .= get_settings('siteurl') . '/wp-login.php';
    138138
     
    222222?>
    223223
    224224<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>
    226226<p><label><?php _e('Password') ?>:<br /> <input type="password" name="pwd" id="pwd" value="" size="20" tabindex="2" /></label></p>
    227227<p class="submit">
    228228        <input type="submit" name="submit" id="submit" value="<?php _e('Login'); ?> &raquo;" tabindex="3" />
     
    244244
    245245break;
    246246} // end action switch
    247 ?>
    248  No newline at end of file
     247?>
  • wp-includes/functions.php

     
    16781678        $login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'");
    16791679
    16801680        if (!$login) {
    1681                 $error = __('<strong>Error</strong>: Wrong login.');
     1681                $error = __('<strong>Error</strong>: Wrong username.');
    16821682                return false;
    16831683        } else {
    16841684                // If the password is already_md5, it has been double hashed.
  • wp-register.php

     
    2828        $user_login = $_POST['user_login'];
    2929        $user_email = $_POST['user_email'];
    3030               
    31         /* checking login has been typed */
     31        /* checking that username has been typed */
    3232        if ($user_login == '') {
    33                 die (__('<strong>ERROR</strong>: Please enter a login.'));
     33                die (__('<strong>ERROR</strong>: Please enter a username.'));
    3434        }
    3535
    3636        /* checking e-mail address */
     
    4040                die (__('<strong>ERROR</strong>: The email address isn&#8217;t correct.'));
    4141        }
    4242
    43         /* checking the login isn't already used by another user */
     43        /* checking the username isn't already used by another user */
    4444        $result = $wpdb->get_results("SELECT user_login FROM $wpdb->users WHERE user_login = '$user_login'");
    4545    if (count($result) >= 1) {
    46                 die (__('<strong>ERROR</strong>: This login is already registered, please choose another one.'));
     46                die (__('<strong>ERROR</strong>: This username is already registered, please choose another one.'));
    4747        }
    4848
    4949        $user_ip = $_SERVER['REMOTE_ADDR'] ;
     
    7373                $stars .= '*';
    7474        }
    7575       
    76         $message  = __('Login') . ": $user_login\r\n";
     76        $message  = __('Username') . ": $user_login\r\n";
    7777        $message .= __('Password') . ": $password\r\n";
    7878        $message .= get_settings('siteurl') . '/wp-login.php';
    7979       
    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);
    8181
    82         $message  = sprintf(__("New user registration on your blog %1\$s:\n\nLogin: %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);
    8383
    8484        @wp_mail(get_settings('admin_email'), sprintf(__('[%s] New User Registration'), get_settings('blogname')), $message);
    8585
     
    100100
    101101<div id="login">
    102102        <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 />
    104104        <?php _e('Password:') ?> <strong>emailed to you</strong><br />
    105105        <?php _e('E-mail:') ?> <strong><?php echo $user_email; ?></strong></p>
    106106        <p class="submit"><a href="wp-login.php"><?php _e('Login'); ?> &raquo;</a></p>
     
    160160
    161161<form method="post" action="wp-register.php" id="registerform">
    162162        <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>
    164164        <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>
    165165        <p>A password will be emailed to you.</p>
    166166        <p class="submit"><input type="submit" value="<?php _e('Register') ?> &raquo;" id="submit" name="submit" /></p>
     
    178178
    179179break;
    180180}
    181 ?>
    182  No newline at end of file
     181?>
  • wp-admin/users.php

     
    3232        $user_lastname  = wp_specialchars($_POST['lastname']);
    3333        $user_uri       = wp_specialchars($_POST['uri']);
    3434               
    35         /* checking login has been typed */
     35        /* checking that username has been typed */
    3636        if ($user_login == '')
    37                 die (__('<strong>ERROR</strong>: Please enter a login.'));
     37                die (__('<strong>ERROR</strong>: Please enter a username.'));
    3838
    3939        /* checking the password has been typed twice */
    4040        do_action('check_passwords', array($user_login, &$pass1, &$pass2));
     
    4747
    4848        $user_nickname = $user_login;
    4949
    50         /* checking the login isn't already used by another user */
     50        /* checking that the username isn't already used by another user */
    5151        $loginthere = $wpdb->get_var("SELECT user_login FROM $wpdb->users WHERE user_login = '$user_login'");
    5252    if ($loginthere)
    53                 die (__('<strong>ERROR</strong>: This login is already registered, please choose another one.'));
     53                die (__('<strong>ERROR</strong>: This username is already registered, please choose another one.'));
    5454
    5555        /* checking e-mail address */
    5656        if (empty($_POST["email"])) {
     
    8282
    8383        $user_login = stripslashes($user_login);
    8484        $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";
    8686
    8787        @wp_mail(get_settings('admin_email'), '[' . get_settings('blogname') . '] New User Registration', $message);
    8888        header('Location: users.php');
  • wp-admin/profile.php

     
    3030
    3131        /* checking the nickname has been typed */
    3232        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)"));
    3434                return false;
    3535        }
    3636
     
    144144
    145145  <table width="99%"  border="0" cellspacing="2" cellpadding="3" class="editform">
    146146    <tr>
    147       <th width="33%" scope="row"><?php _e('Login:') ?></th>
     147      <th width="33%" scope="row"><?php _e('Username:') ?></th>
    148148      <td width="67%"><?php echo $profiledata->user_login; ?></td>
    149149    </tr>
    150150    <tr>
  • wp-admin/user-edit.php

     
    3030
    3131/* checking the nickname has been typed */
    3232if (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)"));
    3434        return false;
    3535}
    3636
     
    9999<form name="edituser" id="edituser" action="user-edit.php" method="post">
    100100<table width="99%"  border="0" cellspacing="2" cellpadding="3">
    101101        <tr>
    102                 <th width="33%" scope="row"><?php _e('Login:') ?></th>
     102                <th width="33%" scope="row"><?php _e('Username:') ?></th>
    103103                <td width="73%"><input type="text" name="new_user_login" id="new_user_login" value="<?php echo $edituser->user_login; ?>" /></td>
    104104        </tr>
    105105        <tr>
     
    209209}
    210210
    211211include('admin-footer.php');
    212 ?>
    213  No newline at end of file
     212?>
  • wp-admin/install.php

     
    193193
    194194<p><em><?php _e('Finished!'); ?></em></p>
    195195
    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>
    197197<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:'); ?>
    198198</p>
    199199<dl>
    200 <dt><?php _e('Login'); ?></dt>
     200<dt><?php _e('Username'); ?></dt>
    201201<dd><code>admin</code></dd>
    202202<dt><?php _e('Password'); ?></dt>
    203203<dd><code><?php echo $random_password; ?></code></dd>