Device Configuration : Protect : Wireless : Hotspots : Login Page Template
Login Page Template
This page gives an overview of possible variables of the hotspot login template.
The HTML template for the login page may contain various variables that can dynamically insert information for the hotspot login page. When the UTM processes a template in order to display a login page, it replaces any template variables with the relevant value. Valid variables are:
General variables
<?company_text?>: Default company text
<?company_logo?>: Default company logo (Sophos logo). The variable will be replaced by the path of the logo file, usage e.g., <img src="<?company_logo?>">
<?admin_contact?>: Administrator name or address as defined on Device Configuration > System > Administration > Notification (Send Notifications to Email Address field)
<?admin_message?>: Administrator information label (default: For administrative questions please contact:)
<?error?>: Error message that arose while trying to log in.
Variables used for all hotspot types
<?terms?>: Terms of use (as defined on Add Hotspot page)
<?redirect_host?>: Redirect URL that is specified for the hotspot (as defined on the Add Hotspot page)
<?location?>: URL the user requested
<?location_host?>: Hostname of the URL the user requested
<?login_form?>: Login form suitable for the respective hotspot type: Password text box, Token text box, Username and Password text boxes, or Accept checkbox, and Login button.
* For creating customized login forms, see User Specific Login Form below.
<?asset_path?> (only important for customization mode Full): Hotspot specific directory for storage of images or stylesheets (example usage: <img src="<?asset_path?>/logo.png">)
Variables only used for voucher type hotspots
<?maclimit?> Number of allowed devices per voucher of this hotspot (as defined on the Add Hotspot page)
<?numdevices?>: Number of devices used for this voucher
<?timeend?>: Validity period (as defined on the Add/Edit Voucher Definition page)
<?time_total?>: Total time quota allowed (as defined on the Add/Edit Voucher Definition page)
<?traffic_total?>: Total data volume allowed (as defined on the Add/Edit Voucher Definition page)
Templates can contain if variables that make up sections like the ones shown below. Each section has an opening and a closing variable. The contents of an if section is only displayed on a specific condition.
If Section
Meaning
<?if_loggedin?>
<?if_loggedin_end?>
Section is displayed when the user has successfully logged in.
<?if_notloggedin?>
<?if_notloggedin_end?>
Section is displayed when the user has not yet logged in, e.g., because terms of use have to be accepted or because an error occurred.
<?if_authtype_password?>
<?if_authtype_password_end?>
Section is displayed when hotspot type is Password of the Day.
<?if_authtype_disclaimer?>
<?if_authtype_disclaimer_end?>
Section is displayed when hotspot type is Terms of Use Acceptance.
<?if_authtype_token?>
<?if_authtype_token_end?>
Section is displayed when hotspot type is Voucher.
<?if_location?>
<?if_location_end?>
Section is displayed when the user has been redirected.
<?if_redirect_url?>
<?if_redirect_url_end?>
Section is displayed when the checkbox Redirect to URL After Login is enabled.
<?if_not_redirect_url?>
<?if_not_redirect_url_end?>
Section is displayed when the checkbox Redirect to URL After Login is disabled.
<?if_timelimit?>
<?if_timelimit_end?>
Section is displayed when a validity period is set for a voucher.
<?if_trafficlimit?>
<?if_trafficlimit_end?>
Section is displayed when a data volume is set for a voucher.
<?if_timequota?>
<?if_timequota_end?>
Section is displayed when a time quota is set for a voucher.
<?if_maclimit?>
<?if_maclimit_end?>
Section is displayed when a Devices per Voucher value is specified.
<?if_terms?>
<?if_terms_end?>
Section is displayed when Terms of Use are defined and enabled.
<?if_error?>
<?if_error_end?>
Section is displayed when an error occurred while trying to log in.
User-Specific Login Form
If you want to create your own login form instead of using the pre-defined <?login_form?> variable, consider the following:
Enclose the form in the following tags:
<form action="?action=login" method="POST"> ... </form>
For a Terms of Use Acceptance hotspot, add a checkbox named "accept":
<input type="checkbox" name="accept">
For Password of the Day or Voucher hotspots, add a text box named "token":
<input type="text" name="token">
Add a means to submit the form, e.g., a Login button:
<input type="submit" name="login" value="Login">