• Resolved sslv

    (@sslv)


    Hi,

    As most websites, I want to show/hide contents/pages of the website according to the current login status (when users are logged-in or logged-out).

    Scenario 1 (LOGGED IN USER):

    Show the Login, Register, Forgot-Password pages only when users are logged-out. (WORKS_AS_EXPECTED). The only issue here is, when the user is logged-in, and tries to access these pages via editing the URL, it will redirect them to edit-account page (how to fix it so it will direct them to custom URL)

    Scenario 2 (LOGGED OUT USER):

    Here I want to show only Home, Login, Register, Forgot-Password page. The issue here is that when a user is logged-in and tries to access pages (manually changing the URL) such as:

    • Profile
    • Edit Account
    • Users
    • Members (page with two buttons)
    • Members/Barbers (page which shows only list of users with user-role:barber)
    • Members/Barber-Shops (page which shows only list of users with user-role:barber-shop)
    • Members/Users-ALL (page should be accessible only by the administrator)
    • This does not work at all. Even though I have specified it in my Appearance/Menus. Se screenshot below:
      https://paste.pics/90e778ee91a4cce438b108b5b98ea2f3

      So my conclusion is that when changing the “Who can see this link?” in my menu the restriction is set only for the appearance of the page IN THE MENU. I’m I correct?

      So how to manage page restrictions? Does UsersWP provide that functionality or do I have to user another plugin / code?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    You will need a bit of customization to achieve this. We have a filter ‘uwp_logged_in_redirect’ which can help you change the URL to a custom URL if accessing after login.

    For 2nd case we don’t have a filter but here is the code if you need to check or modify: https://github.com/AyeCode/userswp/blob/e48c1adb7c31527b6ec5fabad152900665d8c479/includes/class-templates.php#L182

    Who can see this link? is by another plugin which is for menu only.

    Regards,
    Patrik

    Thread Starter sslv

    (@sslv)

    For future developers having this issue I have found the following plugin:

    Content Control – User Access Restriction Plugin by Code Atlantic

    It allows you to create as many restrictions as you want. Lightweight and easy to setup and use. No conflict with UsersWP plugin. Works great!

    Minor improvements of Content Control could be to use a combination of redirecting and custom message! For now it only allows you to do one option at a time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Page Accessibility for Logged-In/Out users not working properly’ is closed to new replies.