• Resolved frank.vanbeek

    (@frankvanbeek)


    Hi there,

    First of all, about my current usage of the FEOU plugin (the plugin and WP are up to date btw):

    1. I have a landing page which prompts a user to login with the details I provided them with
    2. A succesfull login will redirect to a specific page
    3. The specific page contains some shortcode displaying certain information belonging to the user profile

    In my current setup, as mentioned above, the specific page is actually not restricted: the permalink of the page is accessible to anyone, although some information won’t show. In other words: a non-user can also visit the page, when the permalink is obtained.

    My goal: I need the specific page to be non-accessible when it’s not being approached directly through the login. How would I go about and create this setup?

    I searched the forum for a similar case, but couldn’t find anything. Hopefully someone can help out!

    Thanks in advance,

    Frank.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    Hi Frank,

    There’s no way to make the page itself wholly inaccessible via the plugin. You can only restrict the content on the page (either via shortcode or the FE-Users box in the top right on the page edit screen).

    One way to do what you want (it would involve getting in to the code, so only if you’re comfortable with that) would be to make use of our available public function (as explained in our tutorial video here: https://www.youtube.com/watch?v=bKiJAjq7PhQ) to check to see if someone’s logged in and, if not, redirect them to another page. You’d need to do something like create a new page template in your theme and assign that template to your page. Then you could add the public function to that new theme template file. It would be something like:

    <?php
    $FEUP = new FEUP_User;
    if($FEUP->Is_Logged_In()){
      //do something, or nothing
    }
    else{
      header('Location: https://www.google.com/');
    }
    ?>
    

    Change the URL to that of the page you’d want to redirect to. It may take a bit of trial and error on your end, but something like that should help you get closer to what you want.

    Thread Starter frank.vanbeek

    (@frankvanbeek)

    Hi there,

    Thanks for the quick response.

    I’m not quite the programmer, so I wouldn’t quite now what I’m doing, or what to do when something goes wrong. I did find out that WordPress itself offers the possibility to publish a page with the option to secure it with a password. I’ll use this as a temporary solution until I find something else.

    Thanks anyhow for the help,

    KR,
    Frank

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Restrict page with use of login’ is closed to new replies.