Documentation
Frontdesk Installation, Setup, and Use
Client Pages
Overview
Frontdesk's client pages are member pages configured to handle clients. You would only want to use client pages if you want each of your members to have a page that only they can access.
The client pages are located in the /frontdesk/site folder on your web server:
http://example.com/frontdesk/site/register_clients.php http://example.com/frontdesk/site/login_clients.php http://example.com/frontdesk/site/clients/index.php http://example.com/frontdesk/site/clients/logout.php http://example.com/frontdesk/site/clients/profile.php http://example.com/frontdesk/site/clients/test.php
Note: Registration, login, find password, and profile pages for clients work just like their member page counterparts (in the "Member Pages" section above). Password protected pages for clients are slightly different and are discussed below.
Index
The client pages index page (index.php) is set up automatically forward members to their private page after they sign in.
Here's the code for the index page:
<?php
$action = 'ss';
require_once $_SERVER['DOCUMENT_ROOT'] . '/frontdesk/app/frontdesk.php';
check_signed_in('URL TO LOGIN FORM GOES HERE');
extract(get_profile());
send_to_url('/frontdesk/site/clients/' . $username . '.php');
?>
Here's what's happening in the code:
- A session is started for the client.
- If the client isn't logged in, they're sent to a login form.
- Frontdesk looks up the client's account information.
- Frontdesk forwards the client to their private page.
A few important notes on step 4:
- You may notice that client is forwarded to a page that shares the member's username. So, if the member's username is "jenni", the member would land on a page in the client area named "jenni.php".
- Frontdesk can forward users to any page or folder with a name based on any database field (username, first_name, custom_02, etc.). See the "Member Pages" index section above for a full list of database field names.
- You must create the page Frontdesk redirects clients to in advance.
- If you have set up Frontdesk to forward client's to a page named after their username (for example), you must not allow them to change it from their profile page. If a user's username is changed, Frontdesk will redirect them to a new page (based on their new username) that doesn't exist.
Private page
A private page is a password protected page that only one client may access. The demo private page (test.php) is set up to only allow a member with username "test" to access it.
The code at the top of the demo private page follows:
<?php
$action = 'ss';
require_once $_SERVER['DOCUMENT_ROOT'] . '/frontdesk/app/frontdesk.php';
check_signed_in('URL TO LOGIN FORM GOES HERE');
extract(get_profile());
if ($username != 'test') {
die('You do not have permission to access this page.');
}
?>
You should recognize the first few lines as they're the same lines that appear on the index page. The last few lines restrict the page to the "test" user. Here's what they mean: "If the username of the member trying to access this page isn't 'test', don't show this page; just tell them they don't have permission to see it."
Here's how to create private pages for your clients:
- Copy the code lsted above to the top of each private page.
- Replace "test" with the username of the client you're creating the page for.
- Save the page as "username.php", where "username" is of course the username of the client you're making the page for.