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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Redirect from User LoginRedirect from User Login
Previous
 
Next
New Post
5/2/2006 8:47 AM
 

I'm developing a custom module and when the user clicks on a button I need to verify if he/she is log in. If the user is not logged in, I need to send them to the login page and after log in I need them to come back to where they were.

How do I do that?

 
New Post
5/2/2006 2:51 PM
 
You can check to see if the Context.User property is null to see if a user is logged in. I think you can specify a returnurl to the login page, but I'm not sure what the querystring parameter is, exactly.

Beyond this, you might want to consider utilizing the edit access permissions and the IsEditable property of the module.

Michael Flanakin | Microsoft Consulting Services
www.michaelflanakin.com
 
New Post
5/2/2006 3:29 PM
 

Thanks for the reply. Checking for the Context.User worked, but I tried passing returnurl to the login page and it didn't work. Any ideas?

 
New Post
5/2/2006 4:40 PM
 
After looking at the code, the signin user control checks for

PortalSettings.HomeTabId <> -1 And Request.QueryString("override") Is Nothing

If this condition yields true then it redirects to the homepage, but if it is not true then the following statement gets executed:

Response.Redirect(NavigateURL(), True)

Examinig the NavigateUrl function, it redirects to the _portalSettings.ActiveTab.TabID. Which always redirects to the Home Tab. How does it know what the Active Tab is, I don't know. Also if I want it to come back with the querystring, then it won't be possible. Am I looking at the wrong code? Is this a bug? I'm using V4.02. Any ideas?

 
New Post
5/3/2006 8:33 AM
 

Ok, I kind of figured it out. First of all, you have to have the Home Page setting of the site set to <none specified>. After that, you have to redirect to the login the following way:

Dim _PortalSettings As PortalSettings = DotNetNuke.Common.Globals.GetHostPortalSettings()
Dim redirect As String = NavigateURL(Me.TabId, False, _PortalSettings, "Login", Null.NullString)
Response.Redirect(redirect, True)

The only problem with this is I can't pass in querystring parameters to the login page. The last parameter of the NavigateUrl function takes a list of querystring parameters you would like to pass in, but they get added to the url as folder rather than querystring parameters. When the user logs in, the user gets redirected to the correct page with no querystrings.

Any help is appreciated...

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Redirect from User LoginRedirect from User Login


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