How can I password protect a page

3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: May 4, 2016   (RSS)

By Damon - April 27, 2016

Hi Jeff,

For the library-list.php page, you could add this code to display the message for users that aren't logged in:

<?php if (!$CURRENT_USER): ?>
    You need to be a member to access this page.
<?php endif ?>

You could also add a link to login or register etc.

Make sure all the content on the page that should be only visible to users that are logged in uses this code:

<?php if ($CURRENT_USER): ?>
Only logged in users will be able to see this content
<?php endif ?>

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By JeffC - May 4, 2016

Thank you

Jeff