In this article you will learn how to manage your Secure Zones. Before reading this article you will need to have a secure zone created. If you haven't created a secure zone you need to read Creating a Secure Zone and securing your site content article.
You can create an unlimited number of Secure Zones for every site. Visitors and customers may choose to subscribe to more than one site. Visitors can subscribe in one of two methods:
To learn how to manually grant access to private areas, see Subscribing users with access to a password-protected Secure Zone.
You may choose to create hidden, orphaned pages in a Secure Zone that are invisible to normal site visitors. For example, you could create a set of pages that are linked to themselves, but are not linked to any other page of the site. Then, the entire set of pages (like a mini-site) can be placed behind a Secure Zone. In this scenario, you could manually subscriber visitors (such as the business's clients) and they would be the only ones who could log in or even know about a Secure Zone.
However, in many cases you may want to advertise the Secure Zone and enable visitors to discover it and subscribe to it online, without requiring an admin user to enable their subscription. That way, the subscription process can be automated and will not require any maintenance. Follow these steps to create a Secure Zone registration form:

Note: If you are charging for access to a Secure Zone, you can temporarily set the cost for registration to .01 so that your valid credit card is only charged one cent. That way, you can test that the payment gateway is configured correctly to process transactions and the visitors can subscribe online without issues. To learn more about including credit card fields in the form and processing payments, see Charging payment for access to a Secure Zone.
In the next section, you'll learn how to add the login form to the site, to enable subscribers to log into a Secure Zone and access the password-protected content. Once you've added the login form, you can test the site again, to ensure you can successfully log in.
In order for subscribers to enter their user name and password and access a Secure Zone, you'll need to insert a login form on a web page that is outside of the Secure Zone itself. Follow these steps:
You can configure the registration form for a Secure Zone to automatically set the expiration date of a Secure Zone membership. For example, if a new subscriber submits a form to register for a free trial access to a Secure Zone, the form can contain the code that will set the subscriber's expiration date in the system.
To set this up, choose Site Manager> Pages. Select the name of the web page that contains the registration form. The Web Page Details page loads, with the form displayed in the online editor. Click the HTML tab to see the source code for the form.
Edit the source code by adding the line of code below. This line of code creates a field called ZoneExpiry. Enter the date in dd-mmm-yyyy format, as shown below:
<input value="1-Oct-2013" name="ZoneExpiry" id="ExpiryDate" />
In the example shown above, the subscriber's Secure Zone access will expire on 01-October-2013 (October 1st, 2013).
If you'd prefer to have the system generate the expiration date by calculate a number of days from the current date, copy the JavaScript function shown below. This function uses today's date, performs the calculation and inserts the date value into the above field:
function setExpiryDate( )
{
var dat=new Date();
dat.setDate(dat.getDate() + 45);
var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov","Dec")
var pretty = dat.getDate() + "-" + monthname[dat.getMonth()] + "-" + dat.getFullYear();
document.getElementById("ExpiryDate").value = pretty;
}
The example above enables the Secure Zone membership for 45 days from the date the registration form is submitted. You can edit the value "+45" to change the length of the membership. If you want to grant access for one month, change the number 45 to 30, so that the system will calculate 30 days from the date that the form is submitted before the subscriber's access expires.
The last step is to modify the form so the function above is triggered as the form is submitted. To do this go into the HTML view on the webpage the form is inserted into and go to the end of the form contents, you will see a bit of JavaScript looking like this:
What you need to do at this point is add the name of the function - setExpiryDate(); just before the theForm.submit(); string like so:

This way just before the form is submitted the function is triggered, the number of days added to the current date and the resulting date is populated into the input field with the ID "ExpiryDate" we previously defined.
If desired, you can publish a subscriber's customer data (the data stored in the site's customer database) inside a Secure Zone. Since only registered subscribers can log in, it is safe to display the information associated with the logged in subscriber's account. This strategy allows customers to access information relating to them easily and securely. For example you can publish all cases for a given customer in a secure zone so that customer can view these, download any related files, and view the message threads.
To learn more review, read Creating and managing customer cases by providing secure customer service areas.
The Who's Logged In module displays the name of the current subscriber that is logged in to a Secure Zone. When a subscriber logs in, this module displays the following text at the location where you inserted the module:
John Citizen Logged in. Log Out.
Otherwise, the following message is displayed:
No one logged in Log in.
To use the module, edit a web page that is inside a Secure Zone. Use the module manager to add it, by choosing Secure Zone > Display who is logged in from the right sidebar. Alternately, you can copy the tag below and paste it into the source code of the page:
{module_whosloggedin}
To add a link to your login web page so that subscribers can log in, insert the following tag:
{module_whosloggedin,/Login.htm}
To learn more about creating a form within a Secure Zone that enables subscribers to update their account information in a Secure Zone, read Updating customer details and pre-populating form fields.
To get instructions to provide support on the site, see Creating and managing customer cases by providing secure customer service areas.
Copyright 2004 - 2011 Business Catalyst