Skip to content

added multisite current_blog redirect#15

Closed
vabruzzo wants to merge 1 commit intomitcho:masterfrom
vabruzzo:master
Closed

added multisite current_blog redirect#15
vabruzzo wants to merge 1 commit intomitcho:masterfrom
vabruzzo:master

Conversation

@vabruzzo
Copy link

When logging in via shibboleth on a multi-site installation, the user is redirected to the main site, whether or not the user initiated the login on one of the sub-sites. This commit adds a conditional such that, if it's a multi-site install, the user will be redirected to whatever site they initiated the login from. If it's not a multi-site, the usual redirect will occur.

@szul
Copy link

szul commented Jul 23, 2015

This worked well for our setup. The login was dropping us on the dashboard for the master site. After updating my dev branch, the redirect started dropping us on the correct site.

@szul
Copy link

szul commented Jul 25, 2015

Have you gotten this to work when someone paths directly to wp-admin? For example, if I go to example.com/subsite/wp-login.php, this multisite fix works great, and drops me off in the appropriate dashboard, but when I go directly to example.com/subsite/wp-admin/, after the Shibboleth redirect for authentication, it drops me at the main multisite dashboard.

@vabruzzo
Copy link
Author

Hi szul,

Thanks for the feedback. I have tested this and if I navigate to example.com/subsite/wp-admin/ and log in, I am redirected to the correct subsite dashboard. I don't see anything in the code either that would cause your redirect issue. Is it possible this has something to do with your server redirect configs? Not long ago I had an issue with redirects that i thought was caused by shib plugin but was in fact caused by apache configs. I'll kep looking into this and see if I notice anything.

Thanks

@szul
Copy link

szul commented Jul 27, 2015

I tested by having the sysadmin only place the wp-login.php behind Shibboleth to avoid multiple redirects, but you're correct that there could be other redirects that I don't know of causing it to lose its place. If it's working for you, great. I'll have to test further by setting up an isolated environment.

@jrchamp
Copy link
Contributor

jrchamp commented Aug 14, 2015

This put me in a redirect loop. It does fix the link, but I don't think it is looking for my account in the right place. There's probably a number of others places where switch_to_blog() needs to be called for this functionality to work correctly for automatically created accounts.

@vabruzzo
Copy link
Author

vabruzzo commented Sep 1, 2015

Hi @jrchamp, I'm having trouble replicating this loop that you describe. Can you please tell me what your setup looks like? I've signed into the main site, and a subsite, with an unregistered username. The user was created and I was redirected appropriately in each case without a loop.

@jrchamp
Copy link
Contributor

jrchamp commented Sep 2, 2015

I had an unregistered username and attempted to sign into the subsite directly before signing into the main site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants