Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Problem with UrlUtils.DecryptParameter MethodProblem with UrlUtils.DecryptParameter Method
Previous
 
Next
New Post
12/17/2014 9:00 PM
 

Here is the VB Code in question:

  Dim PORTALID As Integer = 0

            If Not Context.Request.QueryString("fileticket") Is Nothing Then
                Dim checkFileId As String = Context.Request.QueryString("fileticket")
                Dim checkDecrypt As String = UrlUtils.DecryptParameter(checkFileId)
                Dim URL As String = "FileID=" & UrlUtils.DecryptParameter(Context.Request.QueryString("fileticket"))
                _FileName = GetHomeDirectory(PORTALID) & GetRelativeFilePath(URL, PORTALID)
            Else

                  (The Else Code doesn't matter, removed it for this post)
              End If

The Portal ID above is being set to 0 because the store inventory for any child portal is really on 0.  Child portals are separate fund raiser projects that sell only items on 0.

The issue is, UrlUtils.DecryptParameter is portal aware.  If the portal is actually greater than 0, it's trying to decrypt a file ticket for that portal.  On portal 0, this code works, on any higher portal, the file ID doesn't get decrypted.

this can be solved by snagging the encryption key and using the 2nd method but I don't know what this key is or where it lives.  I'm sure that's kept encapsulated for obvious reasons.

Another possible solution is write the decryption and insert it in the IF portion of the block prior to assembling _FileName.

I don't see an easy way around this.  There isn't a way to set the Portal Context of the UrlUtils to 0, or some such trick like that.

Any ideas?

 
New Post
12/18/2014 7:02 PM
 
the key is the portal specific GUID i.e. it's retrieved via PortalController.Instance.GetCurrentPortalSettings().GUID.ToString() - you can just execute a var portalSettings = new PortalSettings(portalId) to populate the portalsettings and extract it that way

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Problem with UrlUtils.DecryptParameter MethodProblem with UrlUtils.DecryptParameter Method


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out