Documentation
Password Protection
Overview
In this section, you'll learn how to password protect your website. For each of the setups below, Frontdesk will automatically display a login form whenever users (who aren't logged in) try to access your password protected content.
Password protect a directory
Go to the "Protect" page in the Frontdesk control panel, enter the URL to the directory you want to password protect, and click the "Password protect this directory" button.
Password protect a web page
Upload a copy of /frontdesk/app/helper.php into the directory where the page is located. Copy and paste the following lines to the top of the page you want to protect:
<?php
$action = 'ss';
require $_SERVER['DOCUMENT_ROOT'] . '/frontdesk/app/frontdesk.php';
if (! check_signed_in()) {
require $_SERVER['DOCUMENT_ROOT'] . '/frontdesk/app/templates/login.php';
exit;
}
?>
Password protect a WordPress blog
Upload a copy of /frontdesk/app/helper.php into the /wordpress directory.Copy and paste the lines below to the top of /wordpress/wp-blog-header.php
<?php
$action = 'ss';
require $_SERVER['DOCUMENT_ROOT'] . '/frontdesk/app/frontdesk.php';
if (! check_signed_in()) {
require $_SERVER['DOCUMENT_ROOT'] . '/frontdesk/app/templates/login.php';
exit;
}
?>
Password protect a file download
The idea here is to set up your file download so that it can only be accessed through Frontdesk.
On your web server, create a new folder in the directory where your site's home page is located; give it an unguessable name. For example, something like xBj7p.
Upload the file you want to protect into the new directory.
Open /frontdesk/app/download.php in your favorite text editor. Enter the name of the new folder you created in the space provided near the top of the file.
For example, if you named the directory xBj7p, the line will look like this after you change it:
$download_dir = 'xBj7p'; // No slashes
Now to protect the file you're working with, link to it using the following format:
<a href="/frontdesk/app/download.php?f=[FILENAME]">Download the file</a>>
For example, if the file you want to password protect is named special.zip:
<a href="/frontdesk/app/download.php?f=special.zip">Download the file</a>>