<!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>[9224] sites/trunk: Login: Add a link expired template, and redirect expierd links to that url.</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 { white-space: pre-line; 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/9224">9224</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/9224","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>2019-10-23 06:09:31 +0000 (Wed, 23 Oct 2019)</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: Add a link expired template, and redirect expierd links to that url.

See <a href="http://meta.trac.wordpress.org/ticket/4739">#4739</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_htmlwpcontentthemespubwporgloginjsregistrationjs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/js/registration.js</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_htmlwpcontentthemespubwporgloginpendingcreatephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/pending-create.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpendingprofilephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/pending-profile.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>
<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_htmlwpcontentthemespubwporgloginlinkexpiredphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/linkexpired.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       2019-10-22 06:08:56 UTC (rev 9223)
+++ sites/trunk/common/includes/wporg-sso/wp-plugin.php 2019-10-23 06:09:31 UTC (rev 9224)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,7 +19,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        'root'         => '/',
</span><span class="cx" style="display: block; padding: 0 10px">                        'checkemail'   => '/checkemail',
</span><span class="cx" style="display: block; padding: 0 10px">                        'loggedout'    => '/loggedout',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        'lostpassword' => '/lostpassword',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 'lostpassword' => '/lostpassword(/(?P<user>[^/]+))?',
+                       'linkexpired'  => '/linkexpired(/(?P<reason>register|lostpassword)/(?P<user>[^/]+))?',
</ins><span class="cx" style="display: block; padding: 0 10px">                         'oauth'        => '/oauth',
</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">@@ -153,7 +154,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                $this->valid_sso_paths['register-confirm'] = '/register/confirm/(?P<confirm_user>[^/]+)/(?P<confirm_key>[^/]+)';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                                // Primary registration route.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $this->valid_sso_paths['register']         = '/register';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $this->valid_sso_paths['register']         = '/register(/(?P<user>[^/]+))?';
</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">                        $redirect_req = $this->_get_safer_redirect_to();
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginjsregistrationjs"></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/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        2019-10-22 06:08:56 UTC (rev 9223)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/js/registration.js  2019-10-23 06:09:31 UTC (rev 9224)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -35,5 +35,10 @@
</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">                        } );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+                       // If the form has data in it upon load, immediately trigger the validation.
+                       if ( $loginForm.find('#user_login').val() ) {
+                               $loginForm.find('#user_login').blur();
+                       }
</ins><span class="cx" style="display: block; padding: 0 10px">                 } );
</span><span class="cx" style="display: block; padding: 0 10px"> } )( jQuery );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginlinkexpiredphpfromrev9223sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginloggedoutphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/linkexpired.php (from rev 9223, 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/linkexpired.php                           (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/linkexpired.php     2019-10-23 06:09:31 UTC (rev 9224)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,38 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * The expired link Template
+ *
+ * @package wporg-login
+ */
+
+$reason = WP_WPOrg_SSO::$matched_route_params['reason'] ?? false;
+$user   = WP_WPOrg_SSO::$matched_route_params['user'] ?? false;
+
+get_header();
+?>
+
+<h2 class="center"><?php _e( 'Link Expired', 'wporg' ); ?></h2>
+
+<p class="center"><?php _e( "The link you've followed has expired.", 'wporg' ); ?></p>
+
+<?php
+if ( 'register' == $reason && $user ) {
+               echo '<p class="center"><a href="' . esc_url( home_url( '/register/' . urlencode( $user ) ) ) . '">' .
+                       sprintf(
+                               /* translators: %s: An account name. */
+                               __( 'Start over, and register %s.', 'wporg' ),
+                               '<code>' . esc_html( $register_user ) . '</code>'
+                       ) .
+                       '</a></p>';
+} elseif ( 'lostpassword' == $reason && $user ) {
+       echo '<p class="center"><a href="' . esc_url( home_url( '/lostpassword/'  . urlencode( $user ) ) ) . '">' .
+                       __( 'Reset your password.', 'wporg' ) .
+                       '</a></p>';
+}
+?>
+
+<p id="nav">
+       <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( '&larr; Back to login', 'wporg' ); ?></a>
+</p>
+
+<?php get_footer(); ?>
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginlostpasswordphp"></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/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  2019-10-22 06:08:56 UTC (rev 9223)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/lostpassword.php    2019-10-23 06:09:31 UTC (rev 9224)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,6 +5,8 @@
</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">+$user = WP_WPOrg_SSO::$matched_route_params['user'] ?? false;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> get_header();
</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">@@ -12,7 +14,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        <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' ); ?></p>
</span><span class="cx" style="display: block; padding: 0 10px">        <p>
</span><span class="cx" style="display: block; padding: 0 10px">                <label for="user_login"><?php _e( 'Username or Email', 'wporg' ); ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <input type="text" name="user_login" id="user_login" value="" size="20"></label>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <input type="text" name="user_login" id="user_login" value="<?php echo esc_attr( $user ); ?>" size="20"></label>
</ins><span class="cx" style="display: block; padding: 0 10px">         </p>
</span><span class="cx" style="display: block; padding: 0 10px">        <input type="hidden" name="redirect_to" value="/checkemail/">
</span><span class="cx" style="display: block; padding: 0 10px">        <p class="submit">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,4 +25,4 @@
</span><span class="cx" style="display: block; padding: 0 10px">        <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( '&larr; Back to login', 'wporg' ); ?></a>
</span><span class="cx" style="display: block; padding: 0 10px"> </p>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php get_footer(); ?>
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php get_footer(); ?>
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpendingcreatephp"></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/pending-create.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/pending-create.php        2019-10-22 06:08:56 UTC (rev 9223)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/pending-create.php  2019-10-23 06:09:31 UTC (rev 9224)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,13 +10,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> $pending_user = wporg_get_pending_user( $activation_user );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $pending_user ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        // TODO: add a handler for "Link is expired". The pending user record has been purged.
-       // See Line 33 below for the second case where this is needed.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_safe_redirect( home_url( '/linkexpired/register/' . urlencode( $activation_user ) ) );
+       exit;
</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"> $can_access = false;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $pending_user && $pending_user['user_activation_key'] && ! $pending_user['created'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $expiration_duration = WEEK_IN_SECONDS; // Time that the user has to confirm the account.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $expiration_duration = 2 * WEEK_IN_SECONDS; // Time that the user has to confirm the account.
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        list( $user_request_time, $hashed_activation_key ) = explode( ':', $pending_user['user_activation_key'], 2 );
</span><span class="cx" style="display: block; padding: 0 10px">        $expiration_time                                   = $user_request_time + $expiration_duration;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,10 +26,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">        if ( $hash_is_correct && time() < $expiration_time ) {
</span><span class="cx" style="display: block; padding: 0 10px">                $can_access = true;
</span><span class="cx" style="display: block; padding: 0 10px">        } elseif ( $hash_is_correct ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                // TODO: Add a handler for "Link is expired".
-               // For now, ignore the expiry date on the email links.
-               // This URL is invalidated once the user is created anyway.
-               $can_access = true; 
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         wp_safe_redirect( home_url( '/linkexpired/register/' . urlencode( $activation_user ) ) );
+               exit;
</ins><span class="cx" style="display: block; padding: 0 10px">         }
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $pending_user && $pending_user['created'] ) {
</span><span class="cx" style="display: block; padding: 0 10px">        wp_safe_redirect( 'https://wordpress.org/support/' );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginpendingprofilephp"></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/pending-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/pending-profile.php       2019-10-22 06:08:56 UTC (rev 9223)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/pending-profile.php 2019-10-23 06:09:31 UTC (rev 9224)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -28,7 +28,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        wp_safe_redirect( 'https://wordpress.org/support/' );
</span><span class="cx" style="display: block; padding: 0 10px">        die();
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! $can_access ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        wp_safe_redirect( '/' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_safe_redirect( home_url( '/linkexpired/' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">         die();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginregisterconfirmphp"></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/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      2019-10-22 06:08:56 UTC (rev 9223)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register-confirm.php        2019-10-23 06:09:31 UTC (rev 9224)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,100 +1,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The post-register profile-fields Template
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * An old registration flow template, just redirects to a expired link template now.
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</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">-        //              'register-confirm' => '/register/confirm/(?P<confirm_user>[^/]+)/(?P<confirm_key>[^/]+)',
-
</del><span class="cx" style="display: block; padding: 0 10px"> $confirm_user = isset( WP_WPOrg_SSO::$matched_route_params['confirm_user'] ) ? WP_WPOrg_SSO::$matched_route_params['confirm_user'] : false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$confirm_key  = isset( WP_WPOrg_SSO::$matched_route_params['confirm_key'] ) ? WP_WPOrg_SSO::$matched_route_params['confirm_key'] : false;
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$can_access = true;
-if (
-       $confirm_user && $confirm_key &&
-       ( $user = get_user_by( 'login', $confirm_user ) ) &&
-       $user->exists()
-) {
-       wp_set_current_user( $user->ID );
-
-       $user_activation_key = $user->user_activation_key;
-       if ( ! $user_activation_key ) {
-               // The activation key may not be in the cached user object, so we'll fetch it manually.
-               $user_activation_key = $wpdb->get_var( $wpdb->prepare( "SELECT user_activation_key FROM {$wpdb->users} WHERE ID = %d", $user->ID ) );
-       }
-
-       list( $reset_time, $hashed_activation_key ) = explode( ':', $user_activation_key, 2 );
-
-       if ( empty( $wp_hasher ) ) {
-               require_once ABSPATH . WPINC . '/class-phpass.php';
-               $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'] );
-
-       wporg_login_save_profile_fields();
-
-       add_filter( 'send_password_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( 'Set your password and complete your WordPress.org Profile information.', 'wporg' ); ?>
-</p>
-
-<form name="registerform" id="registerform" action="" method="post">
-
-               <div class="user-pass1-wrap">
-               <p>
-                       <label for="pass1"><?php _e( 'Password', 'wporg' ); ?></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' ); ?></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' ); ?></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' ); ?>" />
-       </p>
-
-</form>
-
-<p id="nav">
-       <a href="https://wordpress.org/"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
-</p>
-
-<?php get_footer();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+wp_safe_redirect( home_url( '/linkexpired/lostpassword/' . urlencode( $confirm_user ) ) );
+exit;
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginregisterprofilephp"></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/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      2019-10-22 06:08:56 UTC (rev 9223)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register-profile.php        2019-10-23 06:09:31 UTC (rev 9224)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,61 +1,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The post-register profile-fields Template
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * An old registration flow template, just redirects to a expired link template now.
</ins><span class="cx" style="display: block; padding: 0 10px">  *
</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><span class="cx" style="display: block; padding: 0 10px"> $profile_user = isset( WP_WPOrg_SSO::$matched_route_params['profile_user'] ) ? WP_WPOrg_SSO::$matched_route_params['profile_user'] : false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$profile_nonce  = isset( WP_WPOrg_SSO::$matched_route_params['profile_nonce'] ) ? WP_WPOrg_SSO::$matched_route_params['profile_nonce'] : false;
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$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();
-}
-
-wporg_login_save_profile_fields();
-
-wp_enqueue_script( 'wporg-registration' );
-
-get_header();
-?>
-<div class="message info">
-       <p><?php
-               printf(
-                       /* translators: %s Email address */
-                       __( 'Please check your email %s for a confirmation link to set your password.', 'wporg' ),
-                       '<code>' . esc_html( wp_get_current_user()->user_email ) . '</code>'
-               );
-       ?></p>
-</div>
-
-<p class="intro">
-<?php _e( 'Complete your WordPress.org Profile information.', 'wporg' ); ?>
-</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' ); ?>" />
-       </p>
-
-</form>
-
-<p id="nav">
-       <a href="https://wordpress.org/"><?php _e( 'WordPress.org', 'wporg' ); ?></a>
-</p>
-
-<?php get_footer(); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+wp_safe_redirect( home_url( '/linkexpired/lostpassword/' . urlencode( $profile_user ) ) );
+exit;
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginregisterphp"></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/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      2019-10-22 06:08:56 UTC (rev 9223)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php        2019-10-23 06:09:31 UTC (rev 9224)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6,6 +6,9 @@
</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_login = isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : '';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( ! $user_login && !empty( WP_WPOrg_SSO::$matched_route_params['user'] ) ) {
+       $user_login = WP_WPOrg_SSO::$matched_route_params['user'];
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> $user_email = isset( $_POST['user_email'] ) ? wp_unslash( $_POST['user_email'] ) : '';
</span><span class="cx" style="display: block; padding: 0 10px"> $user_mailinglist = isset( $_POST['user_mailinglist'] ) && 'true' == $_POST['user_mailinglist'];
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<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     2019-10-22 06:08:56 UTC (rev 9223)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/stylesheets/login.css       2019-10-23 06:09:31 UTC (rev 9224)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -345,7 +345,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> body.route-register-profile #login form p,
</span><span class="cx" style="display: block; padding: 0 10px"> body.route-register-confirm #login form p,
</span><span class="cx" style="display: block; padding: 0 10px"> body.route-pending-profile #login form p,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-body.route-pending-create #login form p {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.route-pending-create #login form p,
+body.route-linkexpired h2,
+body.route-linkexpired p {
</ins><span class="cx" style="display: block; padding: 0 10px">         margin-bottom: 16px;
</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">@@ -378,7 +380,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> body.route-register-profile #login .message,
</span><span class="cx" style="display: block; padding: 0 10px"> body.route-register-confirm #login .message,
</span><span class="cx" style="display: block; padding: 0 10px"> body.route-pending-profile #login .message,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-body.route-pending-create #login .message {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.route-pending-create #login .message,
+body.route-linkexpired #login .message {
</ins><span class="cx" style="display: block; padding: 0 10px">         margin-left: -24px;
</span><span class="cx" style="display: block; padding: 0 10px">        padding-left: 24px;
</span><span class="cx" style="display: block; padding: 0 10px">        padding-right: 24px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -389,7 +392,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> body.route-register-profile #login .message p,
</span><span class="cx" style="display: block; padding: 0 10px"> body.route-register-confirm #login .message p,
</span><span class="cx" style="display: block; padding: 0 10px"> body.route-pending-profile #login .message p,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-body.route-pending-create #login .message p {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.route-pending-create #login .message p,
+body.route-linkexpired #login .message p {
</ins><span class="cx" style="display: block; padding: 0 10px">         margin: 0;
</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">@@ -410,7 +414,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> body.route-register-profile #login .message.error,
</span><span class="cx" style="display: block; padding: 0 10px"> body.route-register-confirm #login .message.error,
</span><span class="cx" style="display: block; padding: 0 10px"> body.route-pending-profile #login .message.error,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-body.route-pending-create #login .message.error {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.route-pending-create #login .message.error,
+body.route-linkexpired #login .message.error {
</ins><span class="cx" style="display: block; padding: 0 10px">         margin-bottom: 30px !important;
</span><span class="cx" style="display: block; padding: 0 10px">        color: #23282d;
</span><span class="cx" style="display: block; padding: 0 10px">        background: #fbfbfb;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -427,7 +432,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> body.rtl.route-register-profile #login .message.error,
</span><span class="cx" style="display: block; padding: 0 10px"> body.rtl.route-register-confirm #login .message.error,
</span><span class="cx" style="display: block; padding: 0 10px"> body.rtl.route-pending-profile #login .message.error,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-body.rtl.route-pending-create #login .message.error {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+body.rtl.route-pending-create #login .message.error,
+body.rtl.route-linkexpired #login .message.error {
</ins><span class="cx" style="display: block; padding: 0 10px">         border-right-color: #dc3232;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre>
</div>
</div>

</body>
</html>