<!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" />
<title>[4470] sites/trunk: Login.WordPress.org: Allow user registration through login.wordpress.org</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/4470">4470</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/4470","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>dd32</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-12-04 17:54:55 +0000 (Sun, 04 Dec 2016)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Login.WordPress.org: Allow user registration through login.wordpress.org

This change does many things, including, but not limited to:
 - Making all the routes have proper templates, rather than being template-parts
 - Removing all the extra WordPress functionalities and outputs
 - Adding the Registration pages and routes
 - Updating SSO to handle routes with URL params
 - Adding rest endpoints for username/email validation

See <a href="http://meta.trac.wordpress.org/ticket/148">#148</a>, <a href="http://meta.trac.wordpress.org/ticket/1524">#1524</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkcommonincludeswporgssowppluginphp">sites/trunk/common/includes/wporg-sso/wp-plugin.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginfunctionsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginheaderphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/header.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginindexphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/index.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginstylesheetslogincss">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/stylesheets/login.css</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglogincheckemailphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/checkemail.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginfunctionsregistrationphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginfunctionsrestapiphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-restapi.php</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/js/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginjsregistrationjs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/js/registration.js</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginloggedoutphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/loggedout.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginloginphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/login.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginlogoutphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/logout.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginlostpasswordphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/lostpassword.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginoauthphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/oauth.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialsregisterprofilefieldsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/register-profilefields.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginregisterconfirmphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register-confirm.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginregisterprofilephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register-profile.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginregisterphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartials404php">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/404.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialscheckemailphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/checkemail.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialsloggedoutphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/loggedout.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialsloginphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/login.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialslogoutphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/logout.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialslostpasswordphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/lostpassword.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialsoauthphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/oauth.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkcommonincludeswporgssowppluginphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/common/includes/wporg-sso/wp-plugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/common/includes/wporg-sso/wp-plugin.php       2016-12-04 17:50:00 UTC (rev 4469)
+++ sites/trunk/common/includes/wporg-sso/wp-plugin.php 2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,9 +21,24 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'loggedout'    => '/loggedout',
</span><span class="cx" style="display: block; padding: 0 10px">                        'lostpassword' => '/lostpassword',
</span><span class="cx" style="display: block; padding: 0 10px">                        'oauth'        => '/oauth',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                        'register-profile' => '/register/profile/(?P<profile_user>[^/]+)/(?P<profile_nonce>[^/]+)',
+                       'register-confirm' => '/register/confirm/(?P<confirm_user>[^/]+)/(?P<confirm_key>[^/]+)',
+                       'register'         => '/register',
</ins><span class="cx" style="display: block; padding: 0 10px">                 );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 * Holds the route hit in `valid_sso_paths`
+                * @var bool|string
+                */
+               static $matched_route = false;
+
+               /**
+                * Holds any matched route params.
+                * @var array
+                */
+               static $matched_route_params = array();
+
+               /**
</ins><span class="cx" style="display: block; padding: 0 10px">                  * Constructor: add our action(s)/filter(s)
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                public function __construct() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -69,12 +84,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                 * @return bool True if user is blocked, false if not.
</span><span class="cx" style="display: block; padding: 0 10px">                 */
</span><span class="cx" style="display: block; padding: 0 10px">                public function disable_password_reset_for_blocked_users( $allow, $user_id ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        if ( ! defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 if ( ! $allow || ! defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                 return $allow;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $user = new WP_User( $user_id, '', WPORG_SUPPORT_FORUMS_BLOGID );
</span><span class="cx" style="display: block; padding: 0 10px">                        $is_blocked = ! empty( $user->allcaps['bbp_blocked'] );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px">                         return ! $is_blocked;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -149,9 +165,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                // If on the SSO host
</span><span class="cx" style="display: block; padding: 0 10px">                                if ( ! preg_match( '!/wp-login\.php$!', $this->script ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                        // ... but not on its login screen.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if ( preg_match( '!^(' . implode( '|', $this->valid_sso_paths ) . ')([/?]{1,2}.*)?$!', $_SERVER['REQUEST_URI'] ) ) {
-                                               // If we're on the path of interest
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 self::$matched_route = false;
+                                       self::$matched_route_params = array();
+                                       foreach ( $this->valid_sso_paths as $route => $regex ) {
+                                               if ( preg_match( '!^' . $regex . '(?:[/?]{1,2}.*)?$!', $_SERVER['REQUEST_URI'], $matches ) ) {
+                                                       self::$matched_route = $route;
+                                                       self::$matched_route_params = $matches;
+                                                       break;
+                                               }
+                                       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        // If we're on the path of interest
+                                       if ( self::$matched_route ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 // Add a custom filter others can apply (theme, etc).
</span><span class="cx" style="display: block; padding: 0 10px">                                                add_filter( 'is_valid_wporg_sso_path' , '__return_true' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,6 +211,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                                                $this->_redirect_to_profile();
</span><span class="cx" style="display: block; padding: 0 10px">                                                        }
</span><span class="cx" style="display: block; padding: 0 10px">                                                }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                        } elseif ( ( is_admin() && is_super_admin() ) || preg_match( '!^/wp-json(/?$|/.+)!i', $_SERVER['REQUEST_URI'] ) ) {
+                                               // Do nothing, allow access to wp-admin and wp-json on login.wordpress.org
</ins><span class="cx" style="display: block; padding: 0 10px">                                         } elseif ( is_user_logged_in() ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                                // Logged in catch all, before last fallback
</span><span class="cx" style="display: block; padding: 0 10px">                                                $this->_redirect_to_profile();
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporglogincheckemailphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/checkemail.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/checkemail.php                            (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/checkemail.php      2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,17 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * The post-resetpassword Template
+ *
+ * @package wporg-login
+ */
+
+get_header();
+?>
+
+<p class="center singleline"><?php _e( 'Check your email for a confirmation link.', 'wporg-login' ); ?></p>
+
+<p id="nav">
+       <a href="/"><?php _e( '&larr; Back to login', 'wporg-login' ); ?></a>
+</p>
+
+<?php get_footer(); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/checkemail.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginfunctionsregistrationphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php                                (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php  2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,80 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+function wporg_login_check_recapcha_status() {
+       if ( empty( $_POST['g-recaptcha-response'] ) ) {
+               return false;
+       }
+       
+       $verify = array(
+       'secret'   => RECAPTCHA_PRIVKEY,
+       'remoteip' => $_SERVER['REMOTE_ADDR'],
+       'response' => $_POST['g-recaptcha-response'],
+       );
+
+     $resp = wp_remote_post( 'https://www.google.com/recaptcha/api/siteverify', array( 'body' => $verify ) );
+
+       if ( is_wp_error( $resp ) || 200 != wp_remote_retrieve_response_code( $resp ) ) {
+               return false;
+       }
+
+       $result = json_decode( wp_remote_retrieve_body( $resp ), true );
+
+       return (bool) $result['success'];
+}
+
+/**
+ * Handles registrations and redirects thereafter
+ */
+function wporg_login_create_user( $user_login, $user_email, $user_mailinglist = false ) {
+       global $wpdb;
+
+       // Allow for w.org plugins to block registrations based on spam checks, etc.
+       if ( null !== ( $pre_register_error = apply_filters( 'wporg_login_pre_registration', null, $user_login, $user_email, $user_mailinglist ) ) ) {
+               if ( is_wp_error( $pre_register_error ) ) {
+                       wp_die( $pre_register_error );
+               }
+               wp_die( __( 'Registration Blocked. Please stop.', 'wporg-login' ) );
+       }
+
+       $user_id = wpmu_create_user( wp_slash( $user_login ), wp_generate_password(), wp_slash( $user_email ) );
+       if ( ! $user_id || is_wp_error( $user_id ) ) {
+               wp_die( __( 'Error! Something went wrong with your registration. Try again?', 'wporg-login' ) );
+       }
+
+       // Insert a hashed activation key
+       $activation_key = wp_generate_password( 24, false, false );
+       if ( empty( $wp_hasher ) ) {
+               $wp_hasher = new PasswordHash( 8, true );
+       }
+       $hashed_activation_key = time() . ':' . $wp_hasher->HashPassword( $activation_key );
+       $bool = $wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed_activation_key ), array( 'ID' => $user_id ) );
+
+       if ( $user_mailinglist ) {
+               update_user_meta( $user_id, 'notify_list', 'true' );
+       }
+       
+       $body  = sprintf( __( 'Hi %s,', 'wporg-login' ), $user_login ) . "\n\n";
+       $body .= __( 'Welcome to WordPress.org! Your new account has been setup.', 'wporg-login' ) . "\n";
+       $body .= "\n";
+       $body .= sprintf( __( 'Your username is: %s', 'wporg-login' ), $user_login ) . "\n";
+       $body .= __( 'You can create a password at the following URL:', 'wporg-login' ) . "\n";
+       $body .= home_url( "/register/confirm/{$user_login}/{$activation_key}/" );
+       $body .= "\n\n";
+       $body .= __( '-- The WordPress.org Team', 'wporg-login' );
+
+       wp_mail(
+               $user_email,
+               __( '[WordPress.org] Your new account', 'wporg-login' ),
+               $body,
+               array(
+                       'From: "WordPress.org" <noreply@wordpress.org>'
+               )
+       );
+
+       wp_set_current_user( $user_id );
+       $nonce = wp_create_nonce( 'login-register-profile-edit' );
+       wp_set_current_user( 0 );
+
+       wp_safe_redirect( '/register/profile/' . $user_login . '/' . $nonce );
+       die();
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginfunctionsrestapiphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-restapi.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-restapi.php                             (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-restapi.php       2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,74 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+function wporg_login_rest_routes() {
+       register_rest_route( 'wporg/v1', '/username-available/(?P<login>[^/]+)', array(
+               'methods'  => WP_REST_Server::READABLE,
+               'callback' => 'wporg_login_rest_username_exists'
+       ) );
+       register_rest_route( 'wporg/v1', '/username-available/?', array(
+               'methods'  => WP_REST_Server::READABLE,
+               'callback' => 'wporg_login_rest_username_exists'
+       ) );
+
+       register_rest_route( 'wporg/v1', '/email-in-use/(?P<email>[^/]*)', array(
+               'methods'  => WP_REST_Server::READABLE,
+               'callback' => 'wporg_login_rest_email_in_use'
+       ) );
+       register_rest_route( 'wporg/v1', '/email-in-use/?', array(
+               'methods'  => WP_REST_Server::READABLE,
+               'callback' => 'wporg_login_rest_email_in_use'
+       ) );
+}
+add_action( 'rest_api_init', 'wporg_login_rest_routes' );
+
+function wporg_login_rest_username_exists( $request ) {
+       $login = trim( $request['login'] );
+
+       $validate_signup = wpmu_validate_user_signup( $login, 'placeholder@placeholder.domain' );
+
+       // We're going to enforce that you can't have a user_login which matches another users user_nicename.. just because sanity.
+       if ( ($user = get_user_by( 'login', $login )) || ($user = get_user_by( 'slug', $login )) ) {
+               return [
+                       'available' => false,
+                       'error' => __( 'That username is already in use.', 'wporg-login' ) . '<br>' . __( 'Is it yours? <a href="/lostpassword">Reset your password</a>.', 'wporg-plugins' ),
+                       'avatar' => get_avatar( $user, 64 ),
+               ];
+       }
+
+       // Perform general validations.
+       $validate_signup_error = $validate_signup['errors']->get_error_message( 'user_name' );
+
+       if ( $validate_signup_error ) {
+               return [
+                       'available' => false,
+                       'error' => $validate_signup_error,
+                       'avatar' => false,
+               ];
+       }
+
+       return [ 'available' => true ];
+}
+
+function wporg_login_rest_email_in_use( $request ) {
+       $email = trim( $request['email'] );
+
+       if ( $user = get_user_by( 'email', $email ) ) {
+               return [
+                       'available' => false,
+                       'error' => __( 'That email address already has an account.', 'wporg-login' ) . '<br>' . __( 'Is it yours? <a href="/lostpassword">Reset your password</a>.', 'wporg-plugins' ),
+                       'avatar' => get_avatar( $user, 64 ),
+               ];
+       }
+
+       $validate_signup = wpmu_validate_user_signup( '', $email );
+       $validate_signup_error = $validate_signup['errors']->get_error_message( 'user_email' );
+       if ( $validate_signup_error ) {
+               return [
+                       'available' => false,
+                       'error' => $validate_signup_error,
+                       'avatar' => false,
+               ];
+       }
+
+       return [ 'available' => true ];
+}
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-restapi.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php     2016-12-04 17:50:00 UTC (rev 4469)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php       2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,6 +5,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @package wporg-login
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+require __DIR__ . '/functions-restapi.php';
+require __DIR__ . '/functions-registration.php';
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px">  * No-cache headers.
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,8 +28,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @return array The filtered body class list.
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function wporg_login_body_class( $classes ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-//      $classes[] = 'wporg-responsive';
-       $classes[] = 'wporg-login';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( WP_WPOrg_SSO::$matched_route ) {
+               $classes[] = 'route-' . WP_WPOrg_SSO::$matched_route;
+       }
+
+       // Remove the 404 class..
+       if ( false !== ( $pos = array_search( 'error404', $classes ) ) ) {
+               unset( $classes[ $pos ] );
+       }
</ins><span class="cx" style="display: block; padding: 0 10px">         return $classes;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'body_class', 'wporg_login_body_class' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +52,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Replace cores login CSS with our own.
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function wporg_login_replace_css() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        wp_enqueue_style( 'wporg-login', get_template_directory_uri() . '/stylesheets/login.css', array( 'login', 'dashicons', 'l10n' ), 2.3 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_enqueue_style( 'wporg-login', get_template_directory_uri() . '/stylesheets/login.css', array( 'login', 'dashicons', 'l10n' ), '20161204' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'login_init', 'wporg_login_replace_css' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,7 +61,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> function wporg_login_scripts() {
</span><span class="cx" style="display: block; padding: 0 10px">        $script_debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $suffix       = $script_debug ? '' : '.min';
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        // Concatenates core scripts when possible.
</span><span class="cx" style="display: block; padding: 0 10px">        if ( ! $script_debug ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,17 +68,68 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        wp_enqueue_style( 'wporg-normalize', get_template_directory_uri() . '/stylesheets/normalize.css', 3 );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        wp_enqueue_style( 'wporg-login', get_template_directory_uri() . '/stylesheets/login.css', array( 'login', 'dashicons', 'l10n' ), 2.3 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_enqueue_style( 'wporg-login', get_template_directory_uri() . '/stylesheets/login.css', array( 'login', 'dashicons', 'l10n' ), '20161204' );
+}
+add_action( 'wp_enqueue_scripts', 'wporg_login_scripts' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        // No emoji support needed.
-       remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
-       remove_action( 'wp_print_styles', 'print_emoji_styles' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wporg_login_register_scripts() {
+       wp_register_script( 'recaptcha-api', 'https://www.google.com/recaptcha/api.js', array(), '2' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        // No Jetpack styles needed.
-       add_filter( 'jetpack_implode_frontend_css', '__return_false' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_register_script( 'wporg-registration', get_template_directory_uri() . "/js/registration.js", array( 'recaptcha-api', 'jquery' ), '20161114' );
+       wp_localize_script( 'wporg-registration', 'wporg_registration', array(
+               'rest_url' => esc_url_raw( rest_url( "wporg/v1" ) )
+       ) );
+}
+add_action( 'init', 'wporg_login_register_scripts' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        // No embeds needed.
-       remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
-       remove_action( 'wp_head', 'wp_oembed_add_host_js' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Avoid sending a 404 header but send a 200 with nocache headers.
+ */
+function wporg_login_pre_handle_404( $false, $wp_query ) {
+       $wp_query->set_404(); // Set the query as 404 to avoid things running thinking it's a real page
+       status_header( 200 ); // but return a 200
+       return true;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-add_action( 'wp_enqueue_scripts', 'wporg_login_scripts' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_filter( 'pre_handle_404', 'wporg_login_pre_handle_404', 10, 2 );
+
+/**
+ * Filters the page template to load wporg-login/$route.php.
+ *
+ * @param array $templates The templates WordPress intends to load.
+ * @return array The templates the theme intends to use.
+ */
+function wporg_login_filter_templates( $templates ) {
+       $route = WP_WPOrg_SSO::$matched_route;
+
+       if ( ! $route || 'root' === $route ) {
+               $route = 'login';
+       }
+
+       return array( "{$route}.php", 'index.php' );
+}
+add_filter( 'index_template_hierarchy', 'wporg_login_filter_templates' );
+
+// No emoji support needed.
+remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
+remove_action( 'wp_print_styles', 'print_emoji_styles' );
+
+// No Jetpack styles needed.
+add_filter( 'jetpack_implode_frontend_css', '__return_false' );
+
+// No embeds needed.
+remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
+remove_action( 'wp_head', 'wp_oembed_add_host_js' );
+remove_action( 'rest_api_init', 'wp_oembed_register_route' );
+
+// Don't perform any WP_Query queries on this site..
+add_filter( 'posts_request', '__return_empty_string' );
+// Don't attempt to do canonical lookups..
+remove_filter( 'template_redirect', 'redirect_canonical' );
+// There's no need to edit the site..
+remove_action( 'wp_head', 'wlwmanifest_link' );
+remove_action( 'wp_head', 'rsd_link' );
+// We don't need all the rest routes either..
+remove_action( 'rest_api_init', 'create_initial_rest_routes', 99 );
+
+// Don't need all the wp-admin specific user metas on user create/update
+add_filter( 'insert_user_meta', '__return_empty_array', 1 );
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginheaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/header.php        2016-12-04 17:50:00 UTC (rev 4469)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/header.php  2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15,7 +15,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> <?php wp_head(); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </head>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<body class="wp-core-ui login">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<body <?php body_class( 'wp-core-ui login' ); ?>>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="login">
</span><span class="cx" style="display: block; padding: 0 10px">        <h1><a href="https://wordpress.org/" title="WordPress.org" tabindex="-1"><?php _e( 'WordPress.org Login' ); ?></a></h1>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginindexphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/index.php 2016-12-04 17:50:00 UTC (rev 4469)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/index.php   2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,35 +5,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @package wporg-login
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-get_header();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// Silence is Golden. If we're at this point, then no template exists for the given request yet.
+wp_safe_redirect( '/' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/**
- * Test if the path we're on is one that we use, depending on if it
- * has a partial or not, or load the 404 partial as fallback.
- *
- * Note that the path is first validated in WP_WPOrg_SSO::redirect_all_login_or_signup_to_sso().
- * @see https://meta.trac.wordpress.org/browser/sites/trunk/common/includes/wporg-sso/wp-plugin.php
- */
-
-if ( apply_filters( 'is_valid_wporg_sso_path', false ) && preg_match( '!^(/[^/\?]*)([/\?]{1,2}.*)?$!', $_SERVER['REQUEST_URI'], $matches ) ) {
-       $screen = '/' === $matches[1] ? 'login' : preg_replace( '/[^a-z0-9-]/', '', $matches[1] );
-} else {
-       $screen = '404';
-}
-
-$partials_dir = __DIR__ . '/partials/';
-$partial      = $partials_dir . $screen . '.php';
-
-if ( file_exists( $partial ) ) {
-       if ( ! headers_sent() ) {
-               status_header( 200 );
-       }
-       require_once( $partial );
-} else {
-       if ( ! headers_sent() ) {
-               status_header( 404 );
-       }
-       require_once( $partials_dir . '404.php');
-}
-
-get_footer();
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginjsregistrationjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/js/registration.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/js/registration.js                                (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/js/registration.js  2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,33 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+jQuery(document).ready(function($){
+       $('#login form').on( 'focus', 'input.error', function() {
+               $(this).removeClass( 'error' );
+       } );
+
+       $('#login form').on( 'blur', '#user_login, #user_email', function() {
+               var $this = $(this);
+               if ( ! $this.val() ) {
+                       return;
+               }
+
+               var rest_url = wporg_registration.rest_url +
+                       ( this.id == 'user_login' ? '/username-available/' : '/email-in-use/' ) +
+                       $this.val();
+
+               $.get( rest_url, function(datas) {
+                       $this.parents('p').nextUntil( 'p', 'div.message.error').remove();
+                       $this.removeClass("good");
+                       if ( ! datas.available ) {
+                               $this.addClass("error");
+                               $this.parents('p').after(
+                                       "<div class='message error'><p>" +
+                                       ( datas.avatar ? datas.avatar : '' ) +
+                                       datas.error +
+                                       "</p></div>"
+                               );
+                       } else {
+                               $this.addClass("good");
+                       }
+               } );
+       } );
+
+});
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginloggedoutphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/loggedout.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/loggedout.php                             (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/loggedout.php       2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,17 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * The logged out Template
+ *
+ * @package wporg-login
+ */
+
+get_header();
+?>
+
+<p class="center"><?php _e( 'You are now logged out.', 'wporg-login' ); ?></p>
+
+<p id="nav">
+       <a href="/"><?php _e( '&larr; Back to login', 'wporg-login' ); ?></a>
+</p>
+
+<?php get_footer(); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/loggedout.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginloginphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/login.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/login.php                         (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/login.php   2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,19 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * The login form Template
+ *
+ * @package wporg-login
+ */
+
+get_header();
+?>
+<p class="intro"><?php _e( 'Log in to your WordPress.org account to contribute to WordPress, get help in the support forum, or rate and review themes and plugins.', 'wporg-login' ); ?></p>
+
+<?php wp_login_form(); ?>
+
+<p id="nav">
+       <a href="/lostpassword/" title="<?php _e( 'Password Lost and Found', 'wporg-login' ); ?>"><?php _e( 'Lost password?', 'wporg-login' ); ?></a> &nbsp; • &nbsp;
+       <a href="https://login.wordpress.org/register/" title="<?php _e( 'Create an account', 'wporg-login' ); ?>"><?php _e( 'Create an account', 'wporg-login' ); ?></a>
+</p>
+
+<?php get_footer(); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/login.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginlogoutphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/logout.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/logout.php                                (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/logout.php  2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,20 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * The logging-out Template
+ *
+ * @package wporg-login
+ */
+
+get_header();
+?>
+<p class="intro"><?php _e( 'You are attempting to log out of WordPress.org.', 'wporg-login' ); ?></p>
+
+<?php
+printf(
+       /* translators: %s: logout URL */
+       __( 'Do you really want to <a href="%s">log out</a>?', 'wporg-login' ),
+       wp_logout_url( home_url( '/loggedout/ ' ) )
+);
+?>
+
+<?php get_footer(); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/logout.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginlostpasswordphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/lostpassword.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/lostpassword.php                          (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/lostpassword.php    2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,26 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * The lost-password Template
+ *
+ * @package wporg-login
+ */
+
+get_header();
+?>
+
+<form name="lostpasswordform" id="lostpasswordform" action="/wp-login.php?action=lostpassword" method="post">
+       <p class="intro"><?php _e( 'Please enter your username or email address. You will receive a link to create a new password via email.', 'wporg-login' ); ?></p>
+       <p>
+               <label for="user_login"><?php _e( 'Username or Email', 'wporg-login' ); ?>
+               <input type="text" name="user_login" id="user_login" value="" size="20"></label>
+       </p>
+       <input type="hidden" name="redirect_to" value="/checkemail/">
+       <p class="submit">
+               <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e( 'Get new password', 'wporg-login' ); ?>">
+       </p>
+</form>
+<p id="nav">
+       <a href="/"><?php _e( '&larr; Back to login', 'wporg-login' ); ?></a>
+</p>
+
+<?php get_footer(); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/lostpassword.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginoauthphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/oauth.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/oauth.php                         (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/oauth.php   2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,17 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * The coming-soon-please-oauth Template
+ *
+ * @package wporg-login
+ */
+
+get_header();
+?>
+
+<p><?php _e( 'Coming soon. :)', 'wporg-login' ); ?></p>
+
+<p id="nav">
+       <a href="/"><?php _e( '&larr; Back to login', 'wporg-login' ); ?></a>
+</p>
+
+<?php get_footer(); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/oauth.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartials404php"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/404.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/404.php  2016-12-04 17:50:00 UTC (rev 4469)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/404.php    2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<p class="center"><?php _e( '404, not found.', 'wporg-login' ); ?></p>
-
-<p id="nav">
-       <a href="/"><?php _e( '&larr; Back to login', 'wporg-login' ); ?></a>
-</p>
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialscheckemailphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/checkemail.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/checkemail.php   2016-12-04 17:50:00 UTC (rev 4469)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/checkemail.php     2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<p class="center singleline"><?php _e( 'Check your email for a confirmation link.', 'wporg-login' ); ?></p>
-
-<p id="nav">
-       <a href="/"><?php _e( '&larr; Back to login', 'wporg-login' ); ?></a>
-</p>
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialsloggedoutphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/loggedout.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/loggedout.php    2016-12-04 17:50:00 UTC (rev 4469)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/loggedout.php      2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<p class="center"><?php _e( 'You are now logged out.', 'wporg-login' ); ?></p>
-
-<p id="nav">
-       <a href="/"><?php _e( '&larr; Back to login', 'wporg-login' ); ?></a>
-</p>
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialsloginphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/login.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/login.php        2016-12-04 17:50:00 UTC (rev 4469)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/login.php  2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,8 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<p class="intro"><?php _e( 'Log in to your WordPress.org account to contribute to WordPress, get help in the support forum, or rate and review themes and plugins.', 'wporg-login' ); ?></p>
-
-<?php wp_login_form(); ?>
-
-<p id="nav">
-       <a href="/lostpassword/" title="<?php _e( 'Password Lost and Found', 'wporg-login' ); ?>"><?php _e( 'Lost password?', 'wporg-login' ); ?></a> &nbsp; • &nbsp;
-       <a href="https://wordpress.org/support/register.php" title="<?php _e( 'Create an account', 'wporg-login' ); ?>"><?php _e( 'Create an account', 'wporg-login' ); ?></a>
-</p>
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialslogoutphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/logout.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/logout.php       2016-12-04 17:50:00 UTC (rev 4469)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/logout.php 2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,9 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<p class="intro"><?php _e( 'You are attempting to log out of WordPress.org.', 'wporg-login' ); ?></p>
-
-<?php
-printf(
-       /* translators: %s: logout URL */
-       __( 'Do you really want to <a href="%s">log out</a>?', 'wporg-login' ),
-       wp_logout_url( home_url( '/loggedout/ ' ) )
-);
-?>
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialslostpasswordphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/lostpassword.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/lostpassword.php 2016-12-04 17:50:00 UTC (rev 4469)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/lostpassword.php   2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,14 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<form name="lostpasswordform" id="lostpasswordform" action="/wp-login.php?action=lostpassword" method="post">
-       <p class="intro"><?php _e( 'Please enter your username or email address. You will receive a link to create a new password via email.', 'wporg-login' ); ?></p>
-       <p>
-               <label for="user_login"><?php _e( 'Username or Email', 'wporg-login' ); ?>
-               <input type="text" name="user_login" id="user_login" value="" size="20"></label>
-       </p>
-       <input type="hidden" name="redirect_to" value="/checkemail/">
-       <p class="submit">
-               <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e( 'Get new password', 'wporg-login' ); ?>">
-       </p>
-</form>
-<p id="nav">
-       <a href="/"><?php _e( '&larr; Back to login', 'wporg-login' ); ?></a>
-</p>
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialsoauthphp"></a>
<div class="delfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Deleted: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/oauth.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/oauth.php        2016-12-04 17:50:00 UTC (rev 4469)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/oauth.php  2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +0,0 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<p><?php _e( 'Coming soon. :)', 'wporg-login' ); ?></p>
-
-<p id="nav">
-       <a href="/"><?php _e( '&larr; Back to login', 'wporg-login' ); ?></a>
-</p>
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpartialsregisterprofilefieldsphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/register-profilefields.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/register-profilefields.php                               (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/register-profilefields.php 2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,54 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * The user profile fields template.
+ *
+ * This template expects that the global $user variable is set.
+ * This template also handles saving of the fields, not ideal, but does the job for now.
+ *
+ * @package wporg-login
+ */
+
+$fields = array(
+       'url'       => '',
+       'from'      => '',
+       'occ'       => '',
+       'interests' => '',
+);
+
+foreach ( array_keys( $fields ) as $field ) {
+       if ( $_POST && isset( $_POST['user_fields'][ $field ] ) ) {
+               $fields[ $field ] = sanitize_text_field( wp_unslash( $_POST['user_fields'][ $field ] ) );
+               if ( 'url' == $field ) {
+                       wp_update_user( array(
+                               'ID' => get_current_user_id(),
+                               'user_url' => esc_url( $fields[ $field ] )
+                       ) );
+               } else {
+                       update_user_meta( $user->ID, $field, $fields[ $field ] );
+               }
+       } else {
+               $fields[ $field ] = ( 'url' === $field ) ? $user->user_url : get_user_meta( $user->ID, $field, true );
+       }
+}
+
+?>
+<p class="login-website">
+       <label for="user_website"><?php _e( 'Website', 'wporg-login' ); ?></label>
+       <input type="text" name="user_fields[url]" id="user_url" class="input" value="<?php echo esc_attr( $fields['url'] ); ?>" size="20" placeholder="https://" />
+</p>
+
+<p class="login-location">
+       <label for="user_location"><?php _e( 'Location', 'wporg-login' ); ?></label>
+       <input type="text" name="user_fields[from]" id="user_location" class="input" value="<?php echo esc_attr( $fields['from'] ); ?>" size="20" />
+</p>
+
+<p class="login-occupation">
+       <label for="user_occupation"><?php _e( 'Occupation', 'wporg-login' ); ?></label>
+       <input type="text" name="user_fields[occ]" id="user_occupation" class="input" value="<?php echo esc_attr( $fields['occ'] ); ?>" size="20" />
+</p>
+
+<p class="login-interests">
+       <label for="user_interests"><?php _e( 'Interests', 'wporg-login' ); ?></label>
+       <input type="text" name="user_fields[interests]" id="user_interests" class="input" value="<?php echo esc_attr( $fields['interests'] ); ?>" size="20" />
+</p>
+
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/partials/register-profilefields.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginregisterconfirmphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register-confirm.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register-confirm.php                              (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register-confirm.php        2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,88 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * The post-register profile-fields Template
+ *
+ * @package wporg-login
+ */
+
+       //              'register-confirm' => '/register/confirm/(?P<confirm_user>[^/]+)/(?P<confirm_key>[^/]+)',
+
+$confirm_user = isset( WP_WPOrg_SSO::$matched_route_params['confirm_user'] ) ? WP_WPOrg_SSO::$matched_route_params['confirm_user'] : false;
+$confirm_key  = isset( WP_WPOrg_SSO::$matched_route_params['confirm_key'] ) ? WP_WPOrg_SSO::$matched_route_params['confirm_key'] : false;
+
+$can_access = true;
+if (
+       $confirm_user && $confirm_key &&
+       ( $user = get_user_by( 'login', $confirm_user ) ) &&
+       $user->exists()
+) {
+       wp_set_current_user( $user->ID );
+       list( $reset_time, $hashed_activation_key ) = explode( ':', $user->user_activation_key, 2 );
+
+       $wp_hasher = new PasswordHash( 8, true );
+       $can_access = $wp_hasher->CheckPassword( $confirm_key, $hashed_activation_key );
+
+       // Keys are only valid for 7 days (or until used)
+       $can_access = $can_access && ( $reset_time + ( 7*DAY_IN_SECONDS ) > time() );
+}
+
+if ( ! $can_access ) {
+       wp_set_current_user( 0 );
+       wp_safe_redirect( "/" );
+       die();
+} elseif ( !empty( $_POST['user_pass'] ) ) {
+       $user_pass = wp_unslash( $_POST['user_pass'] );
+
+       add_filter( 'send_email_change_email', '__return_false' );
+       if ( wp_update_user( wp_slash( array(
+               'ID' => $user->ID,
+               'user_pass' => $user_pass,
+       ) ) ) ) {
+               $wpdb->update( $wpdb->users, array( 'user_activation_key' => '' ), array( 'ID' => $user->ID ) );
+               wp_set_auth_cookie( $user->ID, true );
+               wp_safe_redirect( 'https://wordpress.org/support/' );
+               die();
+       }
+}
+
+wp_enqueue_script( 'zxcvbn' );
+wp_enqueue_script( 'user-profile' );
+wp_enqueue_script( 'wporg-registration' );
+
+get_header();
+?>
+
+<p class="intro">
+<?php _e( 'Complete your WordPress.org Profile information.', 'wporg-login' ); ?>
+</p>
+
+<form name="registerform" id="registerform" action="" method="post">
+
+               <div class="user-pass1-wrap">
+               <p>
+                       <label for="pass1"><?php _e('New Password', 'wporg-login'); ?></label>
+               </p>
+
+               <div class="wp-pwd">
+                       <span class="password-input-wrapper">
+                               <input type="password" data-reveal="1" data-pw="<?php echo esc_attr( wp_generate_password( 16 ) ); ?>" name="user_pass" id="pass1" class="input" size="20" value="" autocomplete="off" aria-describedby="pass-strength-result" />
+                       </span>
+                       <div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php _e( 'Strength indicator', 'wporg-login' ); ?></div>
+               </div>
+       </div>
+
+<!--        <p class="description indicator-hint"><?php _e( 'Hint: The password should be at least twelve characters long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! " ? $ % ^ &amp; ).', 'wporg-login' ); ?></p> -->
+
+       <?php include __DIR__ . '/partials/register-profilefields.php'; ?>
+
+       <p class="login-submit">
+               <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary" value="<?php esc_attr_e( 'Create Account', 'wporg-login' ); ?>" />
+       </p>
+
+</form>
+
+<p id="nav">
+       <a href="https://wordpress.org/"><?php _e( 'WordPress.org', 'wporg-login' ); ?></a> 
+</p>
+
+<?php get_footer(); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register-confirm.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginregisterprofilephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register-profile.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register-profile.php                              (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register-profile.php        2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,51 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * The post-register profile-fields Template
+ *
+ * @package wporg-login
+ */
+
+$profile_user = isset( WP_WPOrg_SSO::$matched_route_params['profile_user'] ) ? WP_WPOrg_SSO::$matched_route_params['profile_user'] : false;
+$profile_nonce  = isset( WP_WPOrg_SSO::$matched_route_params['profile_nonce'] ) ? WP_WPOrg_SSO::$matched_route_params['profile_nonce'] : false;
+
+$can_access = false;
+if (
+       $profile_user && $profile_nonce &&
+       ( $user = get_user_by( 'login', $profile_user ) ) &&
+       $user->exists()
+) {
+       wp_set_current_user( $user->ID );
+       $can_access = wp_verify_nonce( $profile_nonce, 'login-register-profile-edit' );
+}
+
+if ( ! $can_access ) {
+       wp_set_current_user( 0 );
+       wp_safe_redirect( '/' );
+       die();
+}
+
+wp_enqueue_script( 'wporg-registration' );
+
+get_header();
+?>
+<div class="message info"><p><?php _e( "Please check your email for a confirmation link to set your password.", 'wporg-login' ); ?></p></div>
+
+<p class="intro">
+<?php _e( 'Complete your WordPress.org Profile information.', 'wporg-login' ); ?>
+</p>
+
+<form name="registerform" id="registerform" action="" method="post">
+
+       <?php include __DIR__ . '/partials/register-profilefields.php'; ?>
+
+       <p class="login-submit">
+               <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary" value="<?php esc_attr_e( 'Save Profile Information', 'wporg-login' ); ?>" />
+       </p>
+
+</form>
+
+<p id="nav">
+       <a href="https://wordpress.org/"><?php _e( 'WordPress.org', 'wporg-login' ); ?></a> 
+</p>
+
+<?php get_footer(); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register-profile.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginregisterphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php                              (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php        2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,95 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * The new registration Template
+ *
+ * @package wporg-login
+ */
+
+$user_login = isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : '';
+$user_email = isset( $_POST['user_email'] ) ? wp_unslash( $_POST['user_email'] ) : '';
+$user_mailinglist = isset( $_POST['user_mailinglist'] ) && 'true' == $_POST['user_mailinglist'];
+
+$error_user_login = $error_user_email = $error_recapcha_status = false;
+if ( $_POST ) {
+
+       $error_user_login = rest_do_request( new WP_REST_Request( 'GET', '/wporg/v1/username-available/' . $user_login ) );
+       if ( $error_user_login->get_data()['available'] ) {
+               $error_user_login = false;
+       }
+
+       $error_user_email = rest_do_request( new WP_REST_Request( 'GET', '/wporg/v1/email-in-use/' . $user_email ) );
+       if ( $error_user_email->get_data()['available'] ) {
+               $error_user_email = false;
+       }
+
+       // handle user registrations.
+       if ( ! $error_user_login && ! $error_user_email ) {
+               if ( ! wporg_login_check_recapcha_status() ) {
+                       $error_recapcha_status = true;
+               } else {
+                       wporg_login_create_user( $user_login, $user_email, $user_mailinglist );
+                       die();
+               }
+       }
+
+}
+
+wp_enqueue_script( 'wporg-registration' );
+
+get_header();
+?>
+
+<p class="intro"><?php _e( 'Create a WordPress.org account to start contributing to WordPress, get help in the support forums, or rate and review themes and plugins.', 'wporg-login' ); ?></p>
+
+<form name="registerform" id="registerform" action="/register" method="post">
+       <p class="login-username">
+               <label for="user_login"><?php _e( 'Username', 'wporg-login' ); ?></label>
+               <input type="text" name="user_login" id="user_login" class="input <?php if ( $error_user_login ) echo 'error'; ?>" value="<?php echo esc_attr( $user_login ) ?>" size="20" maxlength="60" />
+               <small><?php _e( 'Required, Only lower case letters (a-z) and numbers (0-9) are allowed.', 'wporg-login' ); ?></small>
+       </p>
+       <?php
+               if ( $error_user_login ) {
+                       echo '<div class="message error"><p>' . $error_user_login->get_data()['avatar'] . $error_user_login->get_data()['error'] . '</p></div>';
+               }
+       ?>
+
+       <p class="login-email">
+               <label for="user_email"><?php _e( 'Email', 'wporg-login' ); ?></label>
+               <input type="email" name="user_email" id="user_email" class="input <?php if ( $error_user_email ) echo 'error'; ?>" value="<?php echo esc_attr( $user_email ) ?>" size="20" maxlength="100" />
+               <small><?php _e( 'Required, Your password will be emailed here.', 'wporg-login' ); ?></small>
+       </p>
+       <?php
+               if ( $error_user_email ) {
+                       echo '<div class="message error"><p>' . $error_user_email->get_data()['avatar'] . $error_user_email->get_data()['error'] . '</p></div>';
+               }
+       ?>
+
+       <p class="login-mailinglist">
+               <label>
+                       <input name="user_mailinglist" type="checkbox" id="user_mailinglist" value="true" <?php checked( $user_mailinglist, true ); ?>>
+                       <?php _e( 'Subscribe to WordPress Announcements mailing list (a few messages a year)', 'wporg-login' ); ?>
+               </label>
+       </p>
+
+       <p class="login-recaptcha">
+               <div class="g-recaptcha" data-sitekey="<?php echo esc_attr( RECAPTCHA_PUBKEY ); ?>"></div>
+       </p>
+       <?php
+               if ( $error_recapcha_status ) {
+                       echo '<div class="message error"><p>' . __( 'Please try again.', 'wporg-login' ) . '</p></div>';
+               }
+       ?>
+
+       <p class="login-submit">
+               <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary" value="<?php esc_attr_e( 'Create Account', 'wporg-login' ); ?>" />
+       </p>
+
+</form>
+
+<p id="nav">
+       <a href="/" title="<?php esc_attr_e( 'Already have an account?', 'wporg-login' ); ?>"><?php _e( 'Already have an account?', 'wporg-login' ); ?></a> &nbsp; • &nbsp;
+       <a href="https://wordpress.org/"><?php _e( 'WordPress.org', 'wporg-login' ); ?></a>
+       
+</p>
+
+<?php get_footer(); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginstylesheetslogincss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/stylesheets/login.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/stylesheets/login.css     2016-12-04 17:50:00 UTC (rev 4469)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/stylesheets/login.css       2016-12-04 17:54:55 UTC (rev 4470)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -255,6 +255,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">     background: transparent !important;
</span><span class="cx" style="display: block; padding: 0 10px">     -webkit-box-shadow: none !important;
</span><span class="cx" style="display: block; padding: 0 10px">     box-shadow: none !important;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+    overflow: visible;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> .mobile #login {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -319,6 +320,72 @@
</span><span class="cx" style="display: block; padding: 0 10px">        width: 100%;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+body.route-register,
+body.route-register-profile,
+body.route-register-confirm {
+    padding-top: 105px;
+    height: auto;
+}
+
+body.route-register #login,
+body.route-register-profile #login,
+body.route-register-confirm #login {
+       width: 365px;
+}
+
+body.route-register input.input,
+body.route-register-profile input.input,
+body.route-register-confirm input.input {
+       margin-bottom: 0;
+}
+body.route-register #login form p,
+body.route-register-profile #login form p,
+body.route-register-confirm #login form p {
+       margin-bottom: 16px;
+}
+
+body.login form input.input::-webkit-input-placeholder { /* Chrome/Opera/Safari */
+       opacity: 0.5;
+}
+body.login form input.input::-moz-placeholder { /* Firefox 19+ */
+       opacity: 0.5;
+}
+body.login form input.input:-ms-input-placeholder { /* IE 10+ */
+       opacity: 0.5;
+}
+body.login form input.input:-moz-placeholder { /* Firefox 18- */
+       opacity: 0.5;
+}
+body.login form input.error {
+       background-color: #FAE5E8;
+       border: 3px solid #D42A41;
+}
+body.login form input.good {
+       border-color: #83c373;
+}
+
+body.route-register #login .message.error,
+body.route-register-profile #login .message.error,
+body.route-register-confirm #login .message.error {
+       border-left-color: #dc3232;
+       margin-bottom: auto !important;
+       margin-left: -24px;
+       padding-left: 24px;
+       padding-right: 0;
+}
+body.route-register .message.error .avatar {
+       float: left;
+       border-radius: 50%;
+       margin-right: 1em;
+}
+
+form .login-mailinglist label {
+       font-size: 12px;
+       line-height: 1;
+       cursor: pointer;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> .oauth {
</span><span class="cx" style="display: block; padding: 0 10px">        width: 100%;
</span><span class="cx" style="display: block; padding: 0 10px">        background: #32373c;
</span></span></pre>
</div>
</div>

</body>
</html>