Gatekeeper Downloads Manager

SmithCart > Modules
GateKeeper download manager is a DNN module that is integrated with SmithCart to securely control the distribution of electronic products.  GateKeeper can be used for any b2c or b2b company and can manage any type of downloadable products (i.e. ZIP, EXE, PDF, Videos, Music, etc.).
 
The following velocity checks are configurable by the store admin:
  • Controlling the number of downloads per order detail item
  • Controlling the amount of time during which a customer can download an item (from the date of their first attempt)
Additionally, GateKeeper provides PDF stamping and watermarking features. 
 

Contents

 
 

How it Works

After a user completes an order in SmithCart and click on the download link, GateKeeper will look up the order using the GUID supplied by SmithCart.  We use a GUID for security, as simply using the Order ID would make it easy for outsiders to attempt to download items using similar detail IDs (which are sequential).  Adding a password would work, but the use of a guid essentially provides password protection – along with the record – in one field.
 
If the detail item is found, we check our history of download activity for the item.  If the user has not reached the defined maximum/timeframe, we collect information from the shopping cart about the item and the purchaser and return it to the application.  Our database is updated with the request and then the resulting file (pdf or otherwise) is delivered to the user.
 

Installing GateKeeper

The GateKeeper module is delivered as a standard DNN installable zip or PA (Private Assembly).  Before installing any module it’s a good idea to have a full back up your system. 
 
To purchase a license visit our online store at:
 
To request a license click here:
 
Step 1 – Install GateKeeper just like you would install any other DNN module. 
 
Step 2 – Create a new page in your DNN portal and add the Smith GateKeeper module to the page.
 
 
 

Configuring GateKeeper For Downloads

To load the GateKeeper module settings, hover your mouse over the module context menu and select Settings.
 
 
 
 
The following settings allow you to configure the distribution of your downloadable content:
  • Max Downloads Per Order
  • Max Download Days per Order
  • Downloads Folder
  • Debug Key
  • Reset Key
     
 
 
 
Max Downloads Per Order – After a successful transaction, the value entered in this field will be the number of times the user can download the file. Once the user has downloaded the file this number of times, they will be shown a message that the download limit has been exceeded. Note: you can reset the download count to allow them access by using the reset key (see below).
 
Max Download Days per Order – The value entered here is the maximum number of days the file can be downloaded up to the maximum number of times (above). This can be useful in the case where you want to allow many download attempts for a relatively short period of time.
 
Downloads Folder – The relative url path to the folder containing the files to be downloaded.
For Example: ~/Portals/0/SmithCart/Downloads
 
Debug Key You can get setting information by appending “&debug=code” (where code is a string you supply) to the end of the url.  We decided to not include a default code as it would be too tempting to simply leave it unchanged.
 
Reset Key – Using the value entered in this field (eg, resetcode), any url to the GateKeeper page that has both a GUID and “&r=resetcode” will reset the download count for that customer/product. 
Note: Reset is only available with a valid license.
 

SmithCart Product Setup

To use GateKeeper to deliver digital content from the SmithCart, you must setup the following fields in the “Downloadable Product Setup” section of the Product Setup page.
 
 
 
 
Download URL – The url path to the page containing the GateKeeper module, plus “?g=” which represents the parameter that will contain the GUID (see below) for the detail record.
For Example: http://www.yourdomain/Gatekeeper.aspx?g=
 
Product Path – In this field, enter the name of the file to be downloaded after successful purchase including the extension.
For Example: filename.pdf
 
Auto Generate GUID – Provides additional security features for preventing piracy of your downloadable products. When this checkbox is checked the cart will automatically generate a unique GUID and add the GUID to the end of the download url.
After a successful order, Smith Cart creates an order in the database, sends the confirmation emails and displays a confirmation page with a download link.  When the user clicks on the download link they will be redirected to a page with the gatekeeper module and the managed content is securely delivered to the user by the gatekeeper module.
 

File Download Management

GateKeeper allows you control the distribution of downloadable content by controlling the number of downloads per Product detail item as well as the amount of time during which a customer can download an item.
To manage, add, or edit product file downloads navigate to the Gatekeeper module and click the “Gatekeeper Admin Menu” link.
 
 
 
 
Next, click the button titled “Manage Downloads” from the GateKeeper Admin Menu.
 
 
 
 
The next screen displayed will be the Manage Downloads screen. If records have been added, a grid view will be displayed that lists your File Downloads and allows you manage them.
 
 
 

Add New File Download Record

To add a new File Download Record click the “Add New Record” button:
 
 
 
 
The following add screen is displayed:
 
 
 
 
Product Name – Select the Product you would like to setup a new File Management record for.
 
Max Download Per Order – After a successful transaction, the value entered in this field will be the number of times the user can download the file. Once the user has downloaded the file this number of times, they will be shown a message that the download limit has been exceeded. Note: you can reset the download count to allow them access by using the reset key (see below).
 
Max Download Days per Order – The value entered here is the maximum number of days the file can be downloaded up to the maximum number of times (above). This can be useful in the case where you want to allow many download attempts for a relatively short period of time.
 
After you have configured your File Download click the “Add Record” check button to add the new File Download Record.
 
 
 

Edit and Delete File Download Records

Edit File Download Record
From the grid view that lists your Download Records click the “Edit” pencil button next to the Download Record you wish to edit.  Make the changes to the Record or and click the “Update” check sign button to save your changes.  Click the Cancel Edit button to cancel your changes. 
 
 
 
 
Delete File Download Record
From the grid view that lists your File Download Records click the Delete link next to the Download Record you wish to delete. 
 
 
 
 

Add PDF Watermark

GateKeeper uses the open source iTextSharp component to provide PDF stamping features. When your users click on your download link, GateKeeper looks up the order using the guid supplied by SmithCart. The next step is to lookup the product against predefined PDF stamping templates. If none are found, we treat the file as a simple file transfer request (with the location of the file hidden behind the Download url). If the Product has .PDF Stamp template configured, the template, data and source PDF file are sent to the stamper, where the data is stamped onto each page. Our database is updated with the request and then the resulting file (pdf or otherwise) is delivered to the user.
 
To manage, add, or edit product file downloads navigate to the Gatekeeper module and click the “Gatekeeper Admin Menu” link.
 
 
 
 
Next, click the button titled “Manage Downloads” from the GateKeeper Admin Menu.
 
 
 
 
The next screen displayed will be the Manage PDF Stamp screen. If records have been added, a grid view will be displayed that lists your Stamp Templates and allows you manage them.
 
 

Add New Watermark Stamp Record

To add a new PDF Watermarking Stamp click the “Add New Record” button from the “Add .PDF Watermarking screen:
 
 
 
 
The following add screen will be displayed:
 
 
 
 
Product Name – Select the Product you would like to setup a new PDF Stamp record for.
 
Stamp Template – Specific stamp page definitions are defined in a field, and parsed when loaded.
 
The following table contains all of the fields that can be set:
 
Token Name
Description
Unit=
Internally, everything is in points. However, it’s often difficult to work with, especially when measuring where you want elements to go. The options are: point, cm, mm, and inch. Works with most settings except fontsize.
Lock=
1=lock the pdf from editing; 0=allow editing. Default is 0.
Note: While locking should prevent casual modification attempts, there are programs in the wild that can remove these locks (they are part of the pdf spec and not entirely secure).
Font=
The name of the desired font. Defaults to Helvetica.
Note: The fonts are dependent on what is supported by iTextSharp. Available iTextSharp fonts are: Helvetica, Times, Courier.
Fontsize=
In points
Bold=
1/0
Italic=
1/0
Date=
Format for date strings; eg “yyyy/MM/dd HH:mm” would yield “2010/05/01 23:21”. Uses .Net DateTime.ToString()format.
Color=
RGB values (RED, GREEN, BLUE) – “color=0,0,255” is blue.
Stamp:
Demarks the beginning of a stamp definition for the page. You can have as many stamps as you want (within reason )
Left=
How far from the LEFT edge of the page to place the aligned edge of the text.
Top=
How far up from the BOTTOM of the page to place the text. While top down would have been nice, this is a function of the iTextSharp component
Align=
Text alignment - L, C, R
Rotation=
In degrees (0-360)
Text=
The text to stamp. This is a literal string, except that order data can be included by using stamp variables (see section below).
[FIRSTNAME]
Customer’s First Name
[LASTNAME]
Custom textbox 1 field from Step 1 of the checkout.
[ORDERNO]
Customer’s GUID ID
[DATETIME]
Date and Time of Download
 
 

Edit and Delete PDF Stamp Template Records

Edit File Stamp Template Record
From the grid view that lists your Stamp Template Records click the “Edit” pencil button next to the Template Record you wish to edit.  Make the changes to the Record or and click the “Update” check sign button to save your changes.  Click the Cancel Edit button to cancel your changes.
 
Delete File Download Record
From the grid view that lists your Stamp Template Records click the Delete link next to the Stamp Template you wish to delete. 
 

Amazon S3 Cloud Storage Setup

To configure GateKeeper to download files via Amazon S3 navigate to the page where you have added GateKeeper, hover your mouse over the module context menu and choose Settings.
 
 
 
 
The following settings allow you to configure the distribution of your downloadable content:
  • Max Downloads Per Order
  • Max Download Days per Order
  • Debug Key
  • Reset Key
  • Use Amazon S3
  • AWS Access Key ID
  • AWS Secret Key
 
 
 
Use Amazon S3 – Check this box to enable downloads via Amazon S3
 
AWS Access Key ID - This is actually username. It is alphanumeric text string that uniquely identifies the user who owns account. No two accounts can have same AWS Access Key.
 
AWS Secret Key - This key plays role of password. It's called secret because it is assumed to be known to owner only. A Password with Access Key forms a secure information set that confirms user's identity. You are advised to keep your Secret Key in a safe place.
 
Now your store is ready to serve up file through Amazon S3.  When the Smith Cart creates the order and order detail record, emails and confirmation page, the download link will go to Smith GateKeeper, which will manage the delivery of the content.
 

Usage Notes

  • The debug= parameter will fail if used with a guid whose access has expired. Reset the guid, choose another guid, or remove the “g=” from the url.
  • Transmitting large PDF files may result in a page timeout.  This is due to the time it takes to physically transmit the file.  Including the following line in the web.config file can fix this, though since it also extends the page timeout for all pages, you should be careful when using it.
<httpRuntime executionTimeout="600" useFullyQualifiedRedirectUrl="true" maxRequestLength="8192" requestLengthDiskThreshold="8192" />