<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[12624] trunk: Deprecate generate_random_password().</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12624">12624</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-07 02:22:51 +0000 (Thu, 07 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Deprecate generate_random_password(). fixes <a href="http://trac.wordpress.org/ticket/11746">#11746</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminmseditphp">trunk/wp-admin/ms-edit.php</a></li>
<li><a href="#trunkwpincludesmsfunctionsphp">trunk/wp-includes/ms-functions.php</a></li>
<li><a href="#trunkwpsettingsphp">trunk/wp-settings.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpincludesmsdeprecatedphp">trunk/wp-includes/ms-deprecated.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminmseditphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-edit.php (12623 => 12624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-edit.php        2010-01-07 01:29:40 UTC (rev 12623)
+++ trunk/wp-admin/ms-edit.php        2010-01-07 02:22:51 UTC (rev 12624)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx">                 $password = 'N/A';
</span><span class="cx">                 $user_id = email_exists($email);
</span><span class="cx">                 if( !$user_id ) { // Create a new user with a random password
</span><del>-                        $password = generate_random_password();
</del><ins>+                        $password = wp_generate_password();
</ins><span class="cx">                         $user_id = wpmu_create_user( $domain, $password, $email );
</span><span class="cx">                         if(false == $user_id) {
</span><span class="cx">                                 wp_die( __('There was an error creating the user') );
</span></span></pre></div>
<a id="trunkwpincludesmsdeprecatedphp"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/ms-deprecated.php (0 => 12624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-deprecated.php                                (rev 0)
+++ trunk/wp-includes/ms-deprecated.php        2010-01-07 02:22:51 UTC (rev 12624)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;?php
+
+function generate_random_password( $len = 8 ) {
+        _deprecated_function( __FUNCTION__, '3.0', 'wp_generarte_password()' );
+        $random_password = substr(md5(uniqid(microtime())), 0, intval( $len ) );
+        $random_password = apply_filters('random_password', $random_password);
+        return $random_password;
+}
+
+?&gt;
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-includes/ms-deprecated.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-functions.php (12623 => 12624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-functions.php        2010-01-07 01:29:40 UTC (rev 12623)
+++ trunk/wp-includes/ms-functions.php        2010-01-07 02:22:51 UTC (rev 12624)
</span><span class="lines">@@ -1214,7 +1214,7 @@
</span><span class="cx">         $user_login = $wpdb-&gt;escape($signup-&gt;user_login);
</span><span class="cx">         $user_email = $wpdb-&gt;escape($signup-&gt;user_email);
</span><span class="cx">         wpmu_validate_user_signup($user_login, $user_email);
</span><del>-        $password = generate_random_password();
</del><ins>+        $password = wp_generate_password();
</ins><span class="cx"> 
</span><span class="cx">         $user_id = username_exists($user_login);
</span><span class="cx"> 
</span><span class="lines">@@ -1268,12 +1268,6 @@
</span><span class="cx">         return array('blog_id' =&gt; $blog_id, 'user_id' =&gt; $user_id, 'password' =&gt; $password, 'title' =&gt; $signup-&gt;title, 'meta' =&gt; $meta);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-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;
-}
-
</del><span class="cx"> function wpmu_create_user( $user_name, $password, $email) {
</span><span class="cx">         $user_name = preg_replace( &quot;/\s+/&quot;, '', sanitize_user( $user_name, true ) );
</span><span class="cx">         if ( username_exists($user_name) )
</span></span></pre></div>
<a id="trunkwpsettingsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-settings.php (12623 => 12624)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-settings.php        2010-01-07 01:29:40 UTC (rev 12623)
+++ trunk/wp-settings.php        2010-01-07 02:22:51 UTC (rev 12624)
</span><span class="lines">@@ -405,6 +405,7 @@
</span><span class="cx"> if ( is_multisite() ) {
</span><span class="cx">         require_once( ABSPATH . WPINC . '/ms-functions.php' );
</span><span class="cx">         require_once( ABSPATH . WPINC . '/ms-default-filters.php' );
</span><ins>+        require_once( ABSPATH . WPINC . '/ms-deprecated.php' );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> if ( !defined('WP_CONTENT_URL') )
</span></span></pre>
</div>
</div>

</body>
</html>