<!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>[16284] trunk:
  Generate Human Readable passwords as they are much more userfriendly.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16284">16284</a></dd>
<dt>Author</dt> <dd>westi</dd>
<dt>Date</dt> <dd>2010-11-10 23:31:54 +0000 (Wed, 10 Nov 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Generate Human Readable passwords as they are much more userfriendly. Fixes <a href="http://trac.wordpress.org/ticket/13324">#13324</a> props Otto42.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesupgradephp">trunk/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunkwpadminnetworksitenewphp">trunk/wp-admin/network/site-new.php</a></li>
<li><a href="#trunkwpadminnetworkusernewphp">trunk/wp-admin/network/user-new.php</a></li>
<li><a href="#trunkwpincludesmsfunctionsphp">trunk/wp-includes/ms-functions.php</a></li>
<li><a href="#trunkwploginphp">trunk/wp-login.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesupgradephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/upgrade.php (16283 => 16284)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/upgrade.php        2010-11-10 22:07:07 UTC (rev 16283)
+++ trunk/wp-admin/includes/upgrade.php        2010-11-10 23:31:54 UTC (rev 16284)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">         $user_password = trim($user_password);
</span><span class="cx">         $email_password = false;
</span><span class="cx">         if ( !$user_id &amp;&amp; empty($user_password) ) {
</span><del>-                $user_password = wp_generate_password();
</del><ins>+                $user_password = wp_generate_password( 12, false );
</ins><span class="cx">                 $message = __('&lt;strong&gt;&lt;em&gt;Note that password&lt;/em&gt;&lt;/strong&gt; carefully! It is a &lt;em&gt;random&lt;/em&gt; password that was generated just for you.');
</span><span class="cx">                 $user_id = wp_create_user($user_name, $user_password, $user_email);
</span><span class="cx">                 update_user_option($user_id, 'default_password_nag', true, true);
</span></span></pre></div>
<a id="trunkwpadminnetworksitenewphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network/site-new.php (16283 => 16284)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/site-new.php        2010-11-10 22:07:07 UTC (rev 16283)
+++ trunk/wp-admin/network/site-new.php        2010-11-10 23:31:54 UTC (rev 16284)
</span><span class="lines">@@ -57,7 +57,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 = wp_generate_password();
</del><ins>+                $password = wp_generate_password( 12, false );
</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="trunkwpadminnetworkusernewphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network/user-new.php (16283 => 16284)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/user-new.php        2010-11-10 22:07:07 UTC (rev 16283)
+++ trunk/wp-admin/network/user-new.php        2010-11-10 23:31:54 UTC (rev 16284)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">         elseif ( empty($user['email']) )
</span><span class="cx">                 wp_die( __( 'Missing email.' ) );
</span><span class="cx"> 
</span><del>-        $password = wp_generate_password();
</del><ins>+        $password = wp_generate_password( 12, false);
</ins><span class="cx">         $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
</span><span class="cx"> 
</span><span class="cx">         if ( false == $user_id )
</span></span></pre></div>
<a id="trunkwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-functions.php (16283 => 16284)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-functions.php        2010-11-10 22:07:07 UTC (rev 16283)
+++ trunk/wp-includes/ms-functions.php        2010-11-10 23:31:54 UTC (rev 16284)
</span><span class="lines">@@ -779,7 +779,7 @@
</span><span class="cx">         $meta = unserialize($signup-&gt;meta);
</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><del>-        $password = wp_generate_password();
</del><ins>+        $password = wp_generate_password( 12, false );
</ins><span class="cx"> 
</span><span class="cx">         $user_id = username_exists($user_login);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwploginphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-login.php (16283 => 16284)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-login.php        2010-11-10 22:07:07 UTC (rev 16283)
+++ trunk/wp-login.php        2010-11-10 23:31:54 UTC (rev 16284)
</span><span class="lines">@@ -320,7 +320,7 @@
</span><span class="cx">         if ( $errors-&gt;get_error_code() )
</span><span class="cx">                 return $errors;
</span><span class="cx"> 
</span><del>-        $user_pass = wp_generate_password();
</del><ins>+        $user_pass = wp_generate_password( 12, false);
</ins><span class="cx">         $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
</span><span class="cx">         if ( ! $user_id ) {
</span><span class="cx">                 $errors-&gt;add( 'registerfail', sprintf( __( '&lt;strong&gt;ERROR&lt;/strong&gt;: Couldn&amp;#8217;t register you... please contact the &lt;a href=&quot;mailto:%s&quot;&gt;webmaster&lt;/a&gt; !' ), get_option( 'admin_email' ) ) );
</span></span></pre>
</div>
</div>

</body>
</html>