Login and Registration: Link to the correct site after activating a user on a Multisite install in subdirectory mode.
Props pkarjala, Mista-Flo, tmoore41, Ipstenu, ksoares, mukesh27, whyisjake. Fixes #39311. git-svn-id: https://develop.svn.wordpress.org/trunk@48672 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0dd3bd3b8b
commit
087d11282a
@ -117,6 +117,8 @@ add_action( 'wp_head', 'wpmu_activate_stylesheet' );
|
||||
add_action( 'wp_head', 'wp_sensitive_page_meta' );
|
||||
|
||||
get_header( 'wp-activate' );
|
||||
|
||||
$blog_details = get_blog_details();
|
||||
?>
|
||||
|
||||
<div id="signup-content" class="widecolumn">
|
||||
@ -124,7 +126,7 @@ get_header( 'wp-activate' );
|
||||
<?php if ( ! $key ) { ?>
|
||||
|
||||
<h2><?php _e( 'Activation Key Required' ); ?></h2>
|
||||
<form name="activateform" id="activateform" method="post" action="<?php echo network_site_url( 'wp-activate.php' ); ?>">
|
||||
<form name="activateform" id="activateform" method="post" action="<?php echo network_site_url( $blog_details->path . 'wp-activate.php' ); ?>">
|
||||
<p>
|
||||
<label for="key"><?php _e( 'Activation Key:' ); ?></label>
|
||||
<br /><input type="text" name="key" id="key" value="" size="50" />
|
||||
@ -146,7 +148,7 @@ get_header( 'wp-activate' );
|
||||
printf(
|
||||
/* translators: 1: Login URL, 2: Username, 3: User email address, 4: Lost password URL. */
|
||||
__( 'Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.' ),
|
||||
network_site_url( 'wp-login.php', 'login' ),
|
||||
network_site_url( $blog_details->path . 'wp-login.php', 'login' ),
|
||||
$signup->user_login,
|
||||
$signup->user_email,
|
||||
wp_lostpassword_url()
|
||||
@ -155,7 +157,7 @@ get_header( 'wp-activate' );
|
||||
printf(
|
||||
/* translators: 1: Site URL, 2: Username, 3: User email address, 4: Lost password URL. */
|
||||
__( 'Your site at %1$s is active. You may now log in to your site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.' ),
|
||||
sprintf( '<a href="http://%1$s">%1$s</a>', $signup->domain ),
|
||||
sprintf( '<a href="http://%1$s%2$s">%1$s%2$s</a>', $signup->domain, $blog_details->path ),
|
||||
$signup->user_login,
|
||||
$signup->user_email,
|
||||
wp_lostpassword_url()
|
||||
@ -195,8 +197,12 @@ get_header( 'wp-activate' );
|
||||
<?php else : ?>
|
||||
<p class="view">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: Login URL, 2: Network home URL. */
|
||||
printf( __( 'Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.' ), network_site_url( 'wp-login.php', 'login' ), network_home_url() );
|
||||
__( 'Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.' ),
|
||||
network_site_url( $blog_details->path . 'wp-login.php', 'login' ),
|
||||
network_home_url( $blog_details->path )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
|
@ -605,12 +605,17 @@ function wp_login_form( $args = array() ) {
|
||||
* @return string Lost password URL.
|
||||
*/
|
||||
function wp_lostpassword_url( $redirect = '' ) {
|
||||
$args = array();
|
||||
$args = array(
|
||||
'action' => 'lostpassword',
|
||||
);
|
||||
|
||||
if ( ! empty( $redirect ) ) {
|
||||
$args['redirect_to'] = urlencode( $redirect );
|
||||
}
|
||||
|
||||
$lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) );
|
||||
$blog_details = get_blog_details();
|
||||
|
||||
$lostpassword_url = add_query_arg( $args, network_site_url( $blog_details->path . 'wp-login.php', 'login' ) );
|
||||
|
||||
/**
|
||||
* Filters the Lost Password URL.
|
||||
|
Loading…
Reference in New Issue
Block a user