Support » Networking WordPress » Password reset email contains link to network site, not specific subdomain

  • Drazen

    (@drazenurbanvinecom)


    Hi,

    I’ve setup a multisite network with a few subdomain sites.

    When testing the lost password feature on one of the subdomain sites, lets call it site1.example.com, I received a password reset confirmation email with the following format:

    Someone has asked to reset the password for the following site and username.

    http://example.com/

    Username: johnsmith

    To reset your password visit the following address, otherwise just ignore this email and nothing will happen.

    http://example.com/wp-login.php?action=rp&key=2DuN9MGf8iaBQ4jYo6tZ&login=johnsmith

    Note that it is defaulting to example.com instead of site1.example.com.

    I noticed in wp-login.php that the message is formatted using network_site_url, so I simply changed it to site_url and I now get the correct subdomain links in the email… ie.

    http://site1.example.com/wp-login.php?action=rp&key=2DuN9MGf8iaBQ4jYo6tZ&login=johnsmith

    Is this a minor bug, or is the network site url used for some reason I’m not understanding? Is my simple fix correct, or is there some potential side effect I’m missing?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    The user is signed up to the network as a whole, so it is indeed correct that it gives the main domain and not the subdomain.

    Drazen

    (@drazenurbanvinecom)

    Thank you for the quick reply.

    Maybe its interpretation, but the more common case at least for us is that users are signed up for individual subdomain sites. In our case each subdomain site is dedicated to a particular client and the main domain is our existing website which in not developed in wordpress, so the links with the main site actually break for us.

    The way I’d assumed the use cases to function is if I want to create a user at the network level, I would do so for the network main site. If I’d like to create a user for a specific specific subdomain site, I would do so for the specific subdomain.

    This is semantic hair-splitting, so I can see how it makes sense either way, but for my minor tweak of replacing network_site_url with site_url, can you see any unintended side effects I need to consider?

    Thanks!

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    There’s probably no harm in your change, however remember that the user lists are shared across the whole network. Users are not limited to only logging into one site.

    Andrea Rennick

    (@andrea_r)

    Customer Care at Copyblogger Media and Studiopress

    what otto said. 😉

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Password reset email contains link to network site, not specific subdomain’ is closed to new replies.