BP Suffusion S2Member = Login Redirect Madness
-
Hello all. I’m having trouble with redirects after login.
I’m running WP 3.1.1. BuddyPress 1.2.8, and S2Member 3.5.8
I am also using the Suffusion Theme 3.7.8 and the Suffusion Theme Buddy Press Plugin 1.02I am NOT running multisite.
In the S2 Member options I have NOTHING set for the login redirect page and I have NOTHING set in the login REDIRECT field. So as far as I know, S2 should not be affecting the redirect behavior in any way.
In the admin bar at the top, the login menu item has a hard coded redirect to the site home page. Fine. I understand that and can deal with it.
But when I use the meta widget, the login link that invokes wp-login.php has no redirect parameter.
BUT
When I follow that link to the login form and view page source, I can see a hidden field redirect_to field:
<input type=”hidden” name=”redirect_to” value=”https://www.doityourselfcitizen.com/wp-admin/” />This sucks because I don’t want logged in users to go to the dashboard.
I am using two S2 member levels. Member Level 1 is effectively a subscriber role. It only has the read capability. When I login with an account at this level, it appears that the the user is redirected to their author page. Actually I have a redirect plugin to map all URLs in /author/ space to the corresponding BuddyPress Profile page and that’s where the user ends up. Yay, that’s exactly what I want.
But when I log in using an account that is at the S2Member Level 2, which has the same capabilities as author (e.g. edit_posts, etc), the user ends up at the wp-admin dashboard.
I was trying to puzzle through the wp-login.php and I couldn’t follow it exactly. (I’m new to the world of PHP and WP programming). But I could see tests for the edit_post capability in some code that was messing with a $redirect_to variable.
One last bit of information. All of the above behavior was observed with NOTHING being set in the S2Member Login Welcome page fields in the General Options page. I have experimented both with setting the login redirect and the login welcome page there and I have never been able to create a scenario where those settings were used. As far as I can tell, S2Member is totally cut out of the loop. Based on my reading of some S2Member forum posts, those settings don’t take effect unless there is NO redirect_to form field. But I can’t create any scenario where there is no hidden redirect_to form field in my current set up.
My ultimate goal, is for the user to _always_ be directed to their BuddyPress Profile field when he/she logs in. Eventually I want to totally get rid of the admin bar and I want the end users at both levels to never see the WP Dashboard. (I’ll use the ucanpost plugin instead to let users at level 2 write posts. )
The only thing I know to do at this point is to make sure all login links specify a redirect_to parameter. I could do that. But I could only send folks to a static page because you have to know the page at the time the link is generated and you don’t know who’s logging in at that point so you can’t put the username in the redirect_to URL.
Any guidance or suggestions on things to check would be greatly appreciated.
Thanks,
Calvin
- The topic ‘BP Suffusion S2Member = Login Redirect Madness’ is closed to new replies.