Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Do you have any other plugins activated that affect roles or capabilities?

    Thread Starter Paul Bursnall

    (@style960)

    I have:

    BP Limit Activity Length
    BuddyPress
    BuddyPress Announce Group
    BuddyPress Follow
    BuddyPress Password Strength Meter
    Enhanced Media Library
    HashBuddy
    Invite Anyone
    WP Editor

    I get this too. But I think it’s because the page is trying to refresh to a page that the end user (you’ve just switched to) is not allowed to see (the admin users page).

    If you go from the “cheatin” message to the main page of the site, you will probably see that you are logged in as that end user.

    That is my experience.

    It would be nice if the plugin redirected to the main page instead of a dashboard page, but it may be doing that because of a plugin. I haven’t investigated fully yet.

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    The plugin does indeed only redirect you to the dashboard if the user you’re switching to has the correct capability. If not, you’ll be redirected to the home page.

    Do you have any custom roles or capabilities on your site? Or do you have any plugins which are altering the redirect destination after a user logs in?

    I got this as well, looks like it’s BuddyPress redirecting to the referring page after login. Putting this into the theme’s functions.php sorted it out for me – just removes the BuddyPress login_redirect filter when switching users.

    add_action('init', 'no_bp_redirect_on_user_switching', 9);
    
    function no_bp_redirect_on_user_switching() {
        if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'switch_to_user' ) {
            remove_filter( 'login_redirect', 'bp_login_redirect' );
        }
    }
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Cheatin’ uh?…’ is closed to new replies.