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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow can we secure links in a module?How can we secure links in a module?
Previous
 
Next
New Post
3/12/2013 8:21 AM
 
I think you are correct. QueryString probably won't make it.

Maybe you could hide the parameters in a cookie?

Would it be easier just to convert the target page into a module?

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
3/12/2013 9:07 AM
 
You need to strip the http:// or https:// from your return url.  Here are my functions, use at your own risk :)

public string GetLoginUrlWithReturn()
{
return GetLoginUrl(HttpContext.Current.Request.RawUrl);
}

public string GetLoginUrl()
{
return GetLoginUrl("");
}

public string GetLoginUrl(string returnUrl)
{
            if (returnUrl.ToLower().StartsWith("http://"))
                returnUrl = returnUrl.Substring(6);
            if (returnUrl.ToLower().StartsWith("https://"))
                returnUrl = returnUrl.Substring(7);
            string ret = "";

            if (!string.IsNullOrEmpty(returnUrl))
ret = "returnurl=" + HttpContext.Current.Server.UrlEncode(returnUrl);

if (PortalSettings.LoginTabId != -1)
{
string url = "~/Default.aspx?tabid=" + PortalSettings.LoginTabId.ToString();
if (!string.IsNullOrEmpty(ret))
url += "&" + ret;
return ResolveUrl(url);
}
string url2 = Globals.NavigateURL(TabId, "", "ctl=Login");
            if (!string.IsNullOrEmpty(ret))
            {
                if (url2.Contains("?"))
                    url2 += "&";
                else
                    url2 += "?";
                url2 += ret;
            }
return url2;
}
 
New Post
3/12/2013 9:51 AM
 
Well actually no i cannot convert it to a module, it's a bit complicated i have a sort of connectors that load into that page that take me to different other sites.
 
New Post
3/13/2013 5:22 AM
 
Tried your code Mike, same behavior it's returning me to the Main Page instead the page i'm at.
 
New Post
3/13/2013 7:41 AM
 

I have used the same code available in the login skin object and also same results.

string returnUrl = HttpContext.Current.Request.RawUrl; if (returnUrl.IndexOf("?returnurl=") != -1)                         
{
     returnUrl = returnUrl.Substring(0, returnUrl.IndexOf("?returnurl="));
}                        
returnUrl = HttpUtility.UrlEncode(returnUrl);
PortalModuleBase p = new PortalModuleBase();
hypSource.HRef = DotNetNuke.Common.Globals.LoginURL(returnUrl, (Request.QueryString["override"] != null)); 

And it's still redirecting me to the main page instead of the return url. Is there something i'm missing!!!
 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesHow can we secure links in a module?How can we secure links in a module?


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