Generate random passwords for users created during import. Fixes #5837 props pishmishy.

git-svn-id: https://develop.svn.wordpress.org/trunk@7065 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2008-02-27 18:45:40 +00:00
parent fdb0fcbafe
commit b76a914593
2 changed files with 5 additions and 5 deletions

View File

@ -61,7 +61,7 @@ class MT_Import {
function checkauthor($author) {
global $wpdb;
//mtnames is an array with the names in the mt import file
$pass = 'changeme';
$pass = wp_generate_password();
if (!(in_array($author, $this->mtnames))) { //a new mt author name is found
++ $this->j;
$this->mtnames[$this->j] = $author; //add that new mt author name to an array
@ -153,7 +153,7 @@ class MT_Import {
<h2><?php _e('Assign Authors'); ?></h2>
<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as admin\'s entries.'); ?></p>
<p><?php _e('Below, you can see the names of the authors of the MovableType posts in <i>italics</i>. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.'); ?></p>
<p><?php _e('If a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)'); ?></p>
<p><?php _e('If a new user is created by WordPress, a password will be randomly generated. Manually change the user\'s details if necessary.'); ?></p>
<?php

View File

@ -161,7 +161,7 @@ class WP_Import {
$user_id = username_exists($new_author_name);
if ( !$user_id ) {
$user_id = wp_create_user($new_author_name, 'changeme');
$user_id = wp_create_user($new_author_name, wp_generate_password());
}
$this->author_ids[$in_author_name] = $user_id;
@ -181,7 +181,7 @@ class WP_Import {
<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p>
<?php
if ( $this->allow_create_users() ) {
echo '<p>'.__('If a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)')."</p>\n";
echo '<p>'.__('If a new user is created by WordPress, a password will be randomly generated. Manually change the user\'s details if necessary.')."</p>\n";
}
@ -742,4 +742,4 @@ $wp_import = new WP_Import();
register_importer('wordpress', 'WordPress', __('Import <strong>posts, comments, custom fields, pages, and categories</strong> from a WordPress export file'), array ($wp_import, 'dispatch'));
?>
?>