Skip to content

Commit

Permalink
DNN-9268: Add Version and Edition to Beacon Service Data
Browse files Browse the repository at this point in the history
   - Added the version and product edition (the same as in the Update Service) to the Beacon Service calls
  • Loading branch information
cesarab authored and amarjit-dhunna committed Jan 18, 2017
1 parent ad79af8 commit 05daea8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions DNN Platform/Library/Services/ImprovementsProgram/BeaconService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public string GetBeaconQuery(UserInfo user, string filePath = null)
// r: Role(s) - bitmask - see RolesEnum
// u: User ID - hashed
// f: page name / tab path
// n: Product Edition - hashed
// v: Version - hashed

var uid = user.UserID.ToString("D") + user.CreatedOnDate.ToString("O");
var portalSettings = PortalController.Instance.GetCurrentPortalSettings();
Expand All @@ -101,6 +103,14 @@ public string GetBeaconQuery(UserInfo user, string filePath = null)
if (!string.IsNullOrEmpty(filePath))
qparams["f"] = HttpUtility.UrlEncode(filePath);

//add package and version to context of request
string packageName = DotNetNukeContext.Current.Application.Name;
string installVersion = Common.Globals.FormatVersion(DotNetNukeContext.Current.Application.Version, "00", 3, "");
if (!string.IsNullOrEmpty(packageName))
qparams["n"] = HttpUtility.UrlEncode(GetHash(packageName));
if (!string.IsNullOrEmpty(installVersion))
qparams["v"] = HttpUtility.UrlEncode(GetHash(installVersion));

return "?" + string.Join("&", qparams.Select(kpv => kpv.Key + "=" + kpv.Value));
}

Expand Down

0 comments on commit 05daea8

Please sign in to comment.