<!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>[11046] sites/trunk: Login: When a user is logged in, or an account creation link has already been used, redirect the user more appropriately to a page explaining the issue.</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/11046">11046</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/11046","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>2021-06-21 05:36:48 +0000 (Mon, 21 Jun 2021)</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: When a user is logged in, or an account creation link has already been used, redirect the user more appropriately to a page explaining the issue.
This removes a "random" redirect on certain Login pages that would result in the user redirected to the WordPress.org homepage, or support forums, with no further explanation.
Fixes <a href="http://meta.trac.wordpress.org/ticket/5754">#5754</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkcommonincludeswporgssoclasswporgssophp">sites/trunk/common/includes/wporg-sso/class-wporg-sso.php</a></li>
<li><a href="#sitestrunkcommonincludeswporgssowppluginphp">sites/trunk/common/includes/wporg-sso/wp-plugin.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginlinkexpiredphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/linkexpired.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_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_htmlwpcontentthemespubwporgloginregisterphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkcommonincludeswporgssoclasswporgssophp"></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/class-wporg-sso.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/common/includes/wporg-sso/class-wporg-sso.php 2021-06-21 04:46:29 UTC (rev 11045)
+++ sites/trunk/common/includes/wporg-sso/class-wporg-sso.php 2021-06-21 05:36:48 UTC (rev 11046)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -132,9 +132,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Safe redirect URL from $_REQUEST['redirect_to']
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- protected function _get_safer_redirect_to() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ protected function _get_safer_redirect_to( $default = 'https://wordpress.org/' ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Setup a default redirect to URL, with a safe version to only change if validation succeeds below.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $redirect_to = ! empty( $_GET['action'] ) && in_array( $_GET['action'], array( 'logout', 'loggedout' ) ) ? '/loggedout/' : 'https://wordpress.org/';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $redirect_to = ! empty( $_GET['action'] ) && in_array( $_GET['action'], array( 'logout', 'loggedout' ) ) ? '/loggedout/' : $default;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $_REQUEST['redirect_to'] ) && is_string( $_REQUEST['redirect_to'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // User is requesting a further redirect afterward, let's make sure it's a legit target.
</span></span></pre></div>
<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 2021-06-21 04:46:29 UTC (rev 11045)
+++ sites/trunk/common/includes/wporg-sso/wp-plugin.php 2021-06-21 05:36:48 UTC (rev 11046)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,31 +16,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @var array
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public $valid_sso_paths = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'root' => '/',
- 'robots' => '/robots\.txt',
- 'checkemail' => '/checkemail',
- 'loggedout' => '/loggedout',
- 'lostpassword' => '/lostpassword(/(?P<user>[^/]+))?',
- 'linkexpired' => '/linkexpired(/(?P<reason>register|lostpassword)/(?P<user>[^/]+))?',
- 'oauth' => '/oauth',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'root' => '/',
+ 'robots' => '/robots\.txt',
+ 'checkemail' => '/checkemail',
+ 'loggedout' => '/loggedout',
+ 'lostpassword' => '/lostpassword(/(?P<user>[^/]+))?',
+ 'linkexpired' => '/linkexpired(/(?P<reason>[^/]+)(/(?P<user>[^/]+))?)?',
+ 'oauth' => '/oauth',
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Only for logged in users, but prior to cookies.
- 'updated-tos' => '/updated-policies',
- );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Primarily for logged in users.
+ 'updated-tos' => '/updated-policies',
+ 'logout' => '/logout',
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * List of additional valid paths on login.wordpress.org for logged in requests.
- * @var array
- */
- public $valid_sso_paths_logged_in = array(
- 'logout' => '/logout',
- );
-
- /**
- * List of additional valid paths on login.wordpress.org for logged-out requests.
- * @var array
- */
- public $valid_sso_paths_registration = array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Primarily for logged out users.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'pending-profile' => '/register/create-profile(/(?P<profile_user>[^/]+)/(?P<profile_key>[^/]+))?',
</span><span class="cx" style="display: block; padding: 0 10px"> 'pending-create' => '/register/create(/(?P<confirm_user>[^/]+)/(?P<confirm_key>[^/]+))?',
</span><span class="cx" style="display: block; padding: 0 10px"> 'register' => '/register(/(?P<user>[^/]+))?',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -221,21 +209,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</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">- // Extend paths which are only available for logged in users.
- if ( is_user_logged_in() ) {
- $this->valid_sso_paths = array_merge(
- $this->valid_sso_paths,
- $this->valid_sso_paths_logged_in
- );
-
- // Extend registration paths only when registration is open.
- } elseif ( 'user' === get_site_option( 'registration', 'none' ) ) {
- $this->valid_sso_paths = array_merge(
- $this->valid_sso_paths,
- $this->valid_sso_paths_registration
- );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $redirect_req = $this->_get_safer_redirect_to();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add our host to the list of allowed ones.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -338,14 +311,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else if ( is_user_logged_in() && 'logout' == self::$matched_route ) {
- // No redirect, ask the user if they really want to log out.
- return;
- } else if ( 'robots' === self::$matched_route ) {
- // No redirect, just display robots.
- } else if ( is_user_logged_in() ) {
- // Otherwise, redirect to the their profile.
- $this->_redirect_to_source_or_profile();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif (
</span><span class="cx" style="display: block; padding: 0 10px"> (
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -461,7 +426,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Redirects the user back to where they came from (or w.org profile)
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> protected function _redirect_to_source_or_profile() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $redirect = $this->_get_safer_redirect_to();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $redirect = $this->_get_safer_redirect_to( false );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $redirect ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_safe_redirect( $this->_maybe_add_remote_login_bounce( $redirect ) );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginlinkexpiredphp"></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/linkexpired.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 2021-06-21 04:46:29 UTC (rev 11045)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/linkexpired.php 2021-06-21 05:36:48 UTC (rev 11046)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,21 +13,47 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <h2 class="center"><?php _e( 'Link Expired', 'wporg' ); ?></h2>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<p class="center"><?php _e( "The link you've followed has expired.", 'wporg' ); ?></p>
-
</del><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'register' == $reason && $user ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 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( $user ) . '</code>'
- ) .
- '</a></p>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo '<p class="center">' . __( "The link you've followed has expired.", 'wporg' ) . '</p>';
+
+ 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( $user ) . '</code>'
+ ) .
+ '</a></p>';
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'lostpassword' == $reason && $user ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo '<p class="center">' . __( "The link you've followed has expired.", 'wporg' ) . '</p>';
</ins><span class="cx" style="display: block; padding: 0 10px"> echo '<p class="center"><a href="' . esc_url( home_url( '/lostpassword/' . urlencode( $user ) ) ) . '">' .
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'Reset your password.', 'wporg' ) .
</span><span class="cx" style="display: block; padding: 0 10px"> '</a></p>';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+} elseif ( 'account-created' === $reason ) {
+ echo '<p class="center">' . __( "That account has already been created.", 'wporg' ) . '</p>';
+
+ echo '<p class="center"><a href="' . add_query_arg( 'user', $user, home_url() ) . '">' . __( 'Please login to continue.', 'wporg' ) . '</a></p>';
+
+ echo '<p class="center"><a href="' . esc_url( home_url( '/lostpassword/' . urlencode( $user ) ) ) . '">' .
+ __( 'Reset your password.', 'wporg' ) .
+ '</a></p>';
+
+} elseif ( 'register-logged-in' === $reason ) {
+ echo '<p class="center">' . sprintf(
+ __( 'Please do not make multiple WordPress.org accounts. Please read the <a href="%s">Forum Guidelines</a> for more information.', 'wporg' ),
+ 'https://wordpress.org/support/guidelines/#do-not-create-multiple-accounts-sockpuppets'
+ ) . '</p>';
+
+ echo '<p class="center">' . __( 'Please logout, and folow the link again to complete the registration.', 'wporg' ) . '</p>';
+
+ echo '<p class="center">' . sprintf(
+ /* translators: %s: logout URL */
+ __( 'Do you really want to <a href="%s">log out</a>?', 'wporg' ),
+ wp_logout_url()
+ ) . '</p>';
+
+} else {
+ echo '<p class="center">' . __( "The link you've followed has expired.", 'wporg' ) . '</p>';
</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></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginloginphp"></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/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 2021-06-21 04:46:29 UTC (rev 11045)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/login.php 2021-06-21 05:36:48 UTC (rev 11046)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,8 +10,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> wp_login_form( [
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // pre-fill the last user if their session has simply timed out.
- 'value_username' => wp_parse_auth_cookie()['username'] ?? ''
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // pre-fill with a given username, or with the last user if their session has simply timed out.
+ 'value_username' => $_REQUEST['user'] ?? ( wp_parse_auth_cookie()['username'] ?? '' )
</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></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgloginlogoutphp"></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/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 2021-06-21 04:46:29 UTC (rev 11045)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/logout.php 2021-06-21 05:36:48 UTC (rev 11046)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,6 +5,14 @@
</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">+// This will be validated at redirect time.
+$redirect_to = !empty( $_GET['redirect_to'] ) ? $_GET['redirect_to'] : home_url( '/loggedout/' );
+
+if ( ! is_user_logged_in() ) {
+ wp_safe_redirect( $redirect_to );
+ exit;
+}
+
</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"> <p class="intro"><?php _e( 'You are attempting to log out of WordPress.org.', 'wporg' ); ?></p>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,9 +19,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</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">-// This will be validated at redirect time.
-$redirect_to = !empty( $_GET['redirect_to'] ) ? $_GET['redirect_to'] : home_url( '/loggedout/' );
-
</del><span class="cx" style="display: block; padding: 0 10px"> printf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: logout URL */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'Do you really want to <a href="%s">log out</a>?', 'wporg' ),
</span></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 2021-06-21 04:46:29 UTC (rev 11045)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/pending-create.php 2021-06-21 05:36:48 UTC (rev 11046)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -25,6 +25,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> exit;
</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">+// Already logged in.. Warn about duplicate accounts, etc.
+if ( is_user_logged_in() && $activation_user != wp_get_current_user()->user_login ) {
+ wp_safe_redirect( home_url( '/linkexpired/register-logged-in' ) );
+ exit;
+}
+
</ins><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><span class="cx" style="display: block; padding: 0 10px"> $expiration_duration = 2 * WEEK_IN_SECONDS; // Time that the user has to confirm the account.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,12 +47,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> exit;
</span><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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_safe_redirect( 'https://wordpress.org/support/' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_safe_redirect( home_url( '/linkexpired/account-created/' . urlencode( $pending_user['user_login'] ) ) );
</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 class="cx" style="display: block; padding: 0 10px"> if ( ! $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( '/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_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 2021-06-21 04:46:29 UTC (rev 11045)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/pending-profile.php 2021-06-21 05:36:48 UTC (rev 11046)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,7 +7,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $sso = WPOrg_SSO::get_instance();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Migrate to cookies.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// Migrate to cookies.
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( !empty( $sso::$matched_route_params['profile_user'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> setcookie( 'wporg_profile_user', $sso::$matched_route_params['profile_user'], time()+DAY_IN_SECONDS, '/register/', 'login.wordpress.org', true, true );
</span><span class="cx" style="display: block; padding: 0 10px"> setcookie( 'wporg_profile_key', $sso::$matched_route_params['profile_key'], time()+DAY_IN_SECONDS, '/register/', 'login.wordpress.org', true, true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,6 +21,12 @@
</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( $profile_user );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// Already logged in.. Warn about duplicate accounts, etc.
+if ( is_user_logged_in() ) {
+ wp_safe_redirect( home_url( '/linkexpired/register-logged-in' ) );
+ exit;
+}
+
</ins><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_profile_key'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $expiration_duration = DAY_IN_SECONDS; // The profile-edit screen is short lived.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,7 +42,7 @@
</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"> if ( $can_access && $pending_user['created'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_safe_redirect( 'https://wordpress.org/support/' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_safe_redirect( home_url( '/linkexpired/account-created/' . urlencode( $pending_user['user_login'] ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> die();
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! $can_access ) {
</span><span class="cx" style="display: block; padding: 0 10px"> wp_safe_redirect( home_url( '/linkexpired' ) );
</span></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 2021-06-21 04:46:29 UTC (rev 11045)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php 2021-06-21 05:36:48 UTC (rev 11046)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,6 +14,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $user_login = trim( WP_WPOrg_SSO::$matched_route_params['user'] );
</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">+// Already logged in.. Warn about duplicate accounts, etc.
+if ( is_user_logged_in() ) {
+ wp_safe_redirect( home_url( '/linkexpired/register-logged-in' ) );
+ exit;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $error_user_login = $error_user_email = $error_recapcha_status = $terms_of_service_error = false;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $_POST ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>