WordPress.org

Ready to get started?Download WordPress

Forums

Detect User Role and Redirect to a Members-Only page (4 posts)

  1. marcuswickes
    Member
    Posted 2 years ago #

    I have a private self-hosted wordpress blog that I would only like to allow a few people to access. I don't want users to have to register a unique account on my blog, so I am using the plugin from OneAll to allow social media OAuth registration.

    I am using the basic instructions from this blog post to get all the pieces working: http://wordpress.stackexchange.com/questions/47477/is-there-a-social-members-only-login-plugin-for-wordpress

    Everything works beautifully except that if a user logs in via the OneAll Social Media login, they can still access pages I don't want them to see. The pages aren't visible in the navigation but they may know a direct link to the page. Most of the content is hidden on the page through the "Members" plugin, but because of the way some of the pages are coded, some content is displayed outside of the_content. I would prefer something that detects the user's role and then redirects to a page if they are not yet "upgraded" to member status.

    Suggestions?

  2. This one has a Protected Content page :)

    http://wordpress.org/extend/plugins/membership/

    Kimberly

  3. marcuswickes
    Member
    Posted 2 years ago #

    Thank you for your reply Kimberly.

    I have seen that plugin and tried it out. It does most of what I need for protecting, but it goes a little too far for me (unless I set something up incorrectly).

    You see, I want the user to be able to use the OneAll plugin mentioned above to login. But if the user is not already a member (meaning I -the admin- have not switched their account from "new" to "subscriber"), they get redirected to a page that explains their account registration is pending.

    So for non-logged in users (user type "new"), I want them to be redirected to the login page. I have done that successfully in the Membership options (under "Protected content page") so that no matter what URL I try to access when not logged in, I am successfully redirected. Good.

    But then once the user clicks the social media button from OneAll to login (Twitter for example), they are typically redirected to the page I mentioned above explaining their account is pending registration. But when I turned on the Membership plugin, I can no longer access that page. I have setup the "Positive Rules" for the account level "new" which matches the user role "new" to include the page they should see, but no matter what the user is always redirected to the login page as directed in the protected content page section.

    Suggestions?

  4. Hi Markus.

    Does the plugin have the ability to display two different content types on the same page. In our membership plugin for example you could have the same page handle to sets of logins. so you could basically have to login forms with their own redirects, one would be visible to say your new members and another to the subscribers. the same goes for any content page or post type.

    Cheers

    Tom

Topic Closed

This topic has been closed to new replies.

About this Topic