latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Success: Login redirect based on user level

Home Forums Community Forum Success: Login redirect based on user level

This topic contains 1 reply, has 2 voices. Last updated by  Cristián Lávaque 3 years, 5 months ago.

Topic Author Topic
Posted: Monday Jul 15th, 2013 at 12:21 pm #53471
Vernon James
Username: boro

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Tuesday Jul 16th, 2013 at 9:38 pm #53542

I didn’t notice a security problem there, but I’m not an expert in that. What I did see is that I’d probably simplify it. You can use the Login Welcome Page redirection URL, with a var in the querystring so you can pick it up in your hack checking the $_GET array, and wp_redirect to the page you want based on his level.

So the Login Welcome Page redirection URL could be http://www.mysite.com/members/?login [hilite path]Dashboard -› s2Member® -› General Options -› Login Welcome Page -> Redirection URL[/hilite], and the hack something like:

[hilite pre_code]
0) {
wp_redirect('http://www.mysite.com/members/'.S2MEMBER_CURRENT_USER_LOGIN.'/listings/', 301);
exit;
}
}
[/hilite]

I don’t know where you want to redirect Level 0 users, in the above example they’d go to /members/, while higher level members would be redirected to their own listings as in your code.

Anyway, that’s just an example, I hope it helps. :)

Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.