Make WordPress Core

Ticket #9669: 9669.3.diff

File 9669.3.diff, 1.5 KB (added by Denis-de-Bernardy, 16 years ago)
  • wp-admin/includes/user.php

     
    183183                $user_id = wp_update_user( get_object_vars( $user ));
    184184        } else {
    185185                $user_id = wp_insert_user( get_object_vars( $user ));
    186                 wp_new_user_notification( $user_id );
     186                wp_new_user_notification( $user_id, isset($_POST['send_password']) ? $pass1 : '' );
    187187        }
    188188        return $user_id;
    189189}
     
    830830        echo '</p></div>';
    831831}
    832832
    833 ?>
     833?>
     834 No newline at end of file
  • wp-admin/user-new.php

     
    8787        if ( ! isset($$var) )
    8888                $$var = isset($_POST[$post_field]) ? stripslashes($_POST[$post_field]) : '';
    8989}
     90$new_user_send_password = !$_POST || isset($_POST['send_password']);
    9091?>
    9192<table class="form-table">
    9293        <tr class="form-field form-required">
     
    117118                <br />
    118119                <input name="pass2" type="password" id="pass2" autocomplete="off"/></td>
    119120        </tr>
     121        <tr>
     122                <th scope="row"><label for="send_password"><?php _e('Send Password?') ?></label></th>
     123                <td><label for="send_password"><input type="checkbox" name="send_password" id="send_password" <?php checked($new_user_send_password, true); ?> /> <?php _e('Send this password to the new user by email.'); ?></label></td>
     124        </tr>
    120125<?php endif; ?>
    121126
    122127        <tr class="form-field">