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.

About: Clifford Redgrave

Sorry, I've not written a description yet. I'll get to it soon!


Topics I've Started

Viewing topic 1 (of 1 total)
Topic Count Last Reply
WP-Admin redirecting to login welcome page

By:  Clifford Redgrave in: Community Forum

voices: 2
replies: 2

3 years, 10 months ago  Cristián Lávaque

Viewing topic 1 (of 1 total)

My Latest Replies (From Various Topics)

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Wednesday Mar 13th, 2013 at 5:23 am #44460

Hi,

Have found issue and fixed but definitely worth sharing…

One of my pages does a conditional role change (i.e. upgrade level) using php. top tip is to remember to add an extra condition to only do the role change to a specific current role (which I didn’t).
When I viewed the new page logged in as an admin, it changed my role!

i.e.
$user_id = S2MEMBER_CURRENT_USER_ID;
$user_level = S2MEMBER_CURRENT_USER_ACCESS_LEVEL;
if($user_level == 0)
{
$user = new WP_User($user_id);
$user->set_role(“s2member_level1”);
}

If you ever suffer same fate the fix is to access the wp database directly and edit your wp capabilities in the user meta data table – change it back to administrator!

Viewing 1 replies (of 1 total)

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.