Hi Draggor,
There really is a much better way to do this too Whenever a customer purchases a product we assign them a "Role" that is equal to the product SKU that was purchased. Some simple code like this would parse through all of the roles and determine if they can download the product or not...
Code:
Boolean CanDownload = false;
if (ThisCustomer.Roles.Length != 0)
{
String[] Roles = ThisCustomer.Roles.Split(',');
foreach (string s in Roles)
{
if (s == "sku for product I am protecting here")
{
CanDownload = true;
}
}
if (CanDownload)
{
//Do stuff here
}
}
Obviously you could pass in the SKU you are protecting dynamically instead of hardcoding into the file.