From b343c9ee068c52c132d62c85559ce5951c7d7ae6 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 7 Jan 2010 02:22:51 +0000 Subject: [PATCH] Deprecate generate_random_password(). fixes #11746 git-svn-id: https://develop.svn.wordpress.org/trunk@12624 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/ms-edit.php | 2 +- wp-includes/ms-deprecated.php | 10 ++++++++++ wp-includes/ms-functions.php | 8 +------- wp-settings.php | 1 + 4 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 wp-includes/ms-deprecated.php diff --git a/wp-admin/ms-edit.php b/wp-admin/ms-edit.php index 983f995139..a9b946e083 100644 --- a/wp-admin/ms-edit.php +++ b/wp-admin/ms-edit.php @@ -157,7 +157,7 @@ switch( $_GET['action'] ) { $password = 'N/A'; $user_id = email_exists($email); if( !$user_id ) { // Create a new user with a random password - $password = generate_random_password(); + $password = wp_generate_password(); $user_id = wpmu_create_user( $domain, $password, $email ); if(false == $user_id) { wp_die( __('There was an error creating the user') ); diff --git a/wp-includes/ms-deprecated.php b/wp-includes/ms-deprecated.php new file mode 100644 index 0000000000..5efb4dc118 --- /dev/null +++ b/wp-includes/ms-deprecated.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index bb034068a1..c0487d9ef8 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -1214,7 +1214,7 @@ function wpmu_activate_signup($key) { $user_login = $wpdb->escape($signup->user_login); $user_email = $wpdb->escape($signup->user_email); wpmu_validate_user_signup($user_login, $user_email); - $password = generate_random_password(); + $password = wp_generate_password(); $user_id = username_exists($user_login); @@ -1268,12 +1268,6 @@ function wpmu_activate_signup($key) { return array('blog_id' => $blog_id, 'user_id' => $user_id, 'password' => $password, 'title' => $signup->title, 'meta' => $meta); } -function generate_random_password( $len = 8 ) { - $random_password = substr(md5(uniqid(microtime())), 0, intval( $len ) ); - $random_password = apply_filters('random_password', $random_password); - return $random_password; -} - function wpmu_create_user( $user_name, $password, $email) { $user_name = preg_replace( "/\s+/", '', sanitize_user( $user_name, true ) ); if ( username_exists($user_name) ) diff --git a/wp-settings.php b/wp-settings.php index 98520ffd90..b830380cd4 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -405,6 +405,7 @@ require (ABSPATH . WPINC . '/widgets.php'); if ( is_multisite() ) { require_once( ABSPATH . WPINC . '/ms-functions.php' ); require_once( ABSPATH . WPINC . '/ms-default-filters.php' ); + require_once( ABSPATH . WPINC . '/ms-deprecated.php' ); } if ( !defined('WP_CONTENT_URL') )