• Resolved mwf113

    (@mwf113)


    Client multisite is having issue with child sites redirecting back to main site for lost password. I found code on a previous post that I think addresses this, but it talks about it being in an mu-plugins folder, which I do not have? The code is this:

    <?php
    function ds_login_redirect( $redirect_to, $request_redirect_to, $user )
    {
        if ($user->ID != 0) {
            $user_info = get_userdata($user->ID);
            if ($user_info->primary_blog) {
                $primary_url = get_blogaddress_by_id($user_info->primary_blog) . 'wp-admin/';
                if ($primary_url) {
                    wp_redirect($primary_url);
                    die();
                }
            }
        }
        return $redirect_to;
    }
    add_filter('login_redirect','ds_login_redirect', 100, 3);
    ?>

    I need the user to be able to request a new password, and be redirected back to THEIR site, not main site, because it is creating confusion.

    Current Log in hyperlink points to MAINSITE/wp-login.php
    Register/Back to MAINSITE hyperlink points to MAINSITE

    I need MAINSITE to be CHILDSITE???

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Client multisite is having issue with child sites redirecting back to main site for lost password.

    That’s what’s supposed to happen, FYI.

    Just create the mu-plugins folder if you don’t have one. It’s the same level as your plugins folder, so like this:

    wp-content/
              /mu-plugins
              /themes
              /plugins

    And so on ??

    Will this bug be fixed in any current versions?
    I have been struggling with this using multisite, got the certs good, got the sites good, got the admin area directing right, but the password reset is really messing people up.
    People cannot reset their password for the right site, as everything redirects to the main site they may or may not have access to.
    For now I will review the bug fixes and merges that don’t seem to be in the current 3.9.2 though.
    Thanks for any help or ETA!

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    It’s not a bug. The users are never resetting passwords for their SITE, they are always and forever setting it on the NETWORK.

    Ah, so it’s a usability/design issue and intentional, in other words, not likely to be addressed or changed in core.
    Got it.
    I’m not going to argue semantics of what they’re changing. There is a point to multisite, and if a member only has permission on site A, and they click reset password from site A, they expect the email and link to pertain to site A. The network underneath should be transparent to them. Of course, I as the admin, know the network root and underpinnings, etc.
    thanks

    Point is the URL they are is a certain site and they are requesting a password from a certain site. I considered this a bug at first that everything else, even admin area can be configed to look like a specific site but the password reset and link crudely takes them back to the network root without further ado or explanation.
    I was only thinking of certain members with access to just 1 of the sites.
    It does seem better to educate though, since some people will use multiple sites, and I will look at adjusting the password reset page to make it clear they are changing it for multiple sites.
    I can see a few different cases where people want everything for a certain site to reference that site. I managed to use domain mapping and such so that even the admin area can be transparent, but not being able to configure that one part, the password link stood out like a sore thumb. I was thinking of some limited cases and will change my approach. I did not want to give everyone access to my root site but not doing so would obviously cause confusion if the password reset always references it.
    thanks!

    This is related then. I will change my approach from trying to have certain sites silo’d, since all members must come back to the network root or main site to reset passwords.
    Does this mean in a multisite, all users by nature have access to the main site? I assume yes, and I just noticed they are. If you restrict someone from the root domain site then of course this is counter to wordpress multisite if that’s where they reset passwords for example, right?
    Thank you. I really was thinking of this differently so I’m straightening out my thinking and approach.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Multisite reset password redirect issue’ is closed to new replies.