WordPress.org

Ready to get started?Download WordPress

Forums

Password reset email contains link to network site, not specific subdomain (5 posts)

  1. Drazen
    Member
    Posted 4 years ago #

    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?

  2. 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.

  3. Drazen
    Member
    Posted 4 years ago #

    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!

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 4 years ago #

    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.

  5. what otto said. ;)

Topic Closed

This topic has been closed to new replies.

About this Topic