Modify a Block Page
You can modify a block page to adapt it to your corporate design and to provide additional information, for example, for debugging purposes.
A block page appears on a client of a Web Gateway when a request for web access is blocked. Use the Template Editor to modify what the user sees on this page.
Note: Other pages sent to users can be modified in the same way as block pages.
Modifying the parts of a block page
A block page consists of header and footer with general information and the middle with issue-related information. These parts should be modified in different ways.
Unlike the issue-related information, header and footer information is shown on all block pages, for example, the corporate logo.
Information on a block page is in many cases provided by inserting suitable properties in the page template. For example, to show the media type of a web object, the MediaTypeEnsuredTypes property is inserted, displaying the particular value that applies to a request.
Retrieving a value for a property requires considerable effort in some cases, for example, when Web Gateway must perform a database lookup to retrieve a value, such as the one for Authentication.Username. Other properties, for example, Client.IP requires less effort.
Best practice: Do not insert properties requiring a larger effort to retrieve their values in the header or footer of
a block page to avoid an unnecessary impact on performance.
Modify the footer of a block page
Modify the footer of a block page by inserting additional information for debugging purposes.
Inserting the following properties in the footer of a template for a block page provides useful debugging information. The effort for retrieving the values of these properties is rather small.
- System.Hostname — Host name of the Web Gateway appliance that handled a request for web access
- Proxy.IP — IP address of the Web Gateway appliance that acted as a proxy to handle the request
- Client.IP — IP address of the Web Gateway client that the request was sent from
- Rules.CurrentRule.Name — Name of the rule that was applied when the request was handled
- Rules.CurrentRuleSet.Name — Name of the rule set that the rule belongs to
- Select Policy | Templates.
- In the Templates pane, expand Default Scheme, then expand the language folder that you want to work with, for example, en.
- Click html.
In the File System pane, the index.htm file of the en language folder within the default folder is selected. The content of this file is displayed in the HTML Editor pane.
- Locate this section of the file content:
<tr> <td class='footData'> generated at <span id="time">$DateTime.ToISOString$/<span> by Web Gateway <br /> $Get.Header$ </td> </tr>
- Replace this section with the following:
<tr> <td class='footData'> generated at $<propertyInstance useMostRecentConfiguration="false" propertyId="com.scur.engine.datetimefilter.datetime.toisostring"/>$ by $<propertyInstance useMostRecentConfiguration="false" propertyId="com.scur.engine.system.hostname"/>$ ($<propertyInstance useMostRecentConfiguration="false" propertyId="com.scur.engine.system.proxy.ip"/>$) <br /> Client IP Address: $<propertyInstance useMostRecentConfiguration="false" propertyId="com.scur.engine.system.client.ip"/>$ <br /> Rule Name: $<propertyInstance useMostRecentConfiguration="false" propertyId="com.scur.engine.system.rules.currentrulename"/>$ ($<propertyInstance useMostRecentConfiguration="false" propertyId="com.scur.engine.system.rules.currentrulesetname"/>$) </td> </tr>
After replacing the section, the terms representing properties are converted to display the property names.
The result should look like this:
<tr> <td class='footData'> generated at $DateTime.ToISOString$ by $System.Hostname$ ($Proxy.IP$) <br /> Client IP Address: $Client.IP$ <br /> Rule Name: $Rules.CurrentRuleName$ ($Rules.CurrentRuleSetName$) </td> </tr>
In the footer of a real block page, the current property values will be shown, for example, as follows:
<tr> <td class='footData'> generated at 2016-09-30 by testhost (10.120.233.2) <br /> Client IP Address: 10.120.233.10 <br /> Rule Name: Allow URLs that match in URL WhiteList (URL Filtering) </td> </tr>
- Click Save Changes.
Modify the issue-related part of a block page
Insert additional information in the issue-related part of a block page.
The additional information can, for example, be information about a user who sent a request for web access and has successfully passed the authentication process.
The Authentication.Username property must be inserted in the block page to provide this information. Retrieving a value for this property requires a lookup, but the effort can still be considered as reasonable, as his lookup is not performed each time a block page is displayed.
- Select Policy | Templates.
- In the Templates pane, expand Default Scheme, then expand the template and language folders that you want to work with, for example, URL.Blocked, and then en.
- Click html.
In the File System pane, the URL.Blocked.htm file of the en language folder within the default folder is selected. The content of this file is displayed in the HTML Editor pane. - Locate this section of the file content:
<tr> <td class='infoData'> <b>URL</b><script type="text/javascript">break_line("$URL$");</script><br /> <script type="text/javascript">writeToDocument("<b>URL Categories: </b>" + "$Categorylist.ToString"></script><br /> <b>Reputation</b>: $URLReputationString$<br /> <b>Media Type</b>: $MediaType.EnsuredTypes$<br />
- Copy the following line and paste it below the original line.
<b>Media Type</b>: $MediaType.EnsuredTypes$<br />
- Replace the words Media Type by User in the pasted line.
- Delete the property name in this line and place the cursor inside the area that is now empty, then click Add.
- In the Choose Property window that opens, select Authentication.Username and click OK.
The property is inserted in the line. Its current value will now be shown when the block page is displayed. - Click Save Changes.
Change the logo on a block page
Replace the default logo file with a file of your own to change the logo on a block page.
- Store an image file with your logo in a location of your file system.
- Navigate to the default image file.
- Select Policy | Templates.
- In the File System pane, expand default, and then img.
All image files that are stored in the file system appear.
- Replace the default image file with your file.
- Copy the file named mwg_logo.png and rename it to mwg_logo.png-bak.
- Close the img folder, select the closed folder, and click Add
- From the menu that opens, select Existing file or directory, then select your image file in the file system window that opens and click Open
The file appears in the img folder. - Rename the file to mwg_logo.png
Note:You can give the file a different name, but then you must also replace the default name in the following line of the index.html file in the default folder with the new name. <img src='$Proxy.EndUserURL$/files/default/img/logo_mwg.png'>
- Click Save Changes.
Change the color of the background bars on a block page
Replace the default image file for the background bars with a file of your own to change the color of those bars.
- Store an image file with background bars of your preferred color in a location of your file system.
- Navigate to the default image file.
- Select Policy | Templates.
- In the File System pane, expand default, and then img.
All image files that are stored in the file system appear.
- Replace the default image file with your file.
- Copy the file named bg_navbar.png and rename it to bg_navbar.png-bak.
- Close the img folder, select the closed folder, and click Add.
- From the menu that opens, select Existing file or directory, then select your image file in the file system window that opens and click Open.
The file appears in the img folder. - Rename the file to bg_navbar.png .
NOTE: You can give the file a different name, but then you must also replace the default name in the following line of the index.html file in the default folder with the new name. <td class='helpDeskData' background='$Proxy.EndUserURL$/files/ $Proxy.Message.Collection$/img/bg_navbar.jpg'>
- Click Save Changes.
You can change more colors by modifying the stylessheet.ccs file in the default folder.
For example, by replacing the color code in the following line, you can modify the general background color of the template.
body { background-color: #ced1d4;... }