Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Affordable ASP.NET Hosting Service
  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Redirect from User Login
Previous Previous
 
Next Next
New Post 5/2/2006 6:47 AM
User is offline Jonas Stawski
21 posts
10th Ranked


Redirect from User Login 

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 12:51 PM
User is offline Michael Flanakin
994 posts
www.michaelflanakin.com
7th Ranked




Re: Redirect from User Login 
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 1:29 PM
User is offline Jonas Stawski
21 posts
10th Ranked


Re: Redirect from User Login 

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 2:40 PM
User is offline Jonas Stawski
21 posts
10th Ranked


Re: Redirect from User Login 
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 6:33 AM
User is offline Jonas Stawski
21 posts
10th Ranked


Re: Redirect from User Login 

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 Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Redirect from User Login
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Digicon: DotNetNuke design and development
Digicon is based in Brisbane, Queensland, Australia
digicon.com.au
Live Visitor Tracking & Live Chat For DotNetNuke
Track your visitors in real time and add live chat for sales & support. Free Trial.
www.whoson.com
SINA101
WANT A SPECial sIte iN TAIWAN?
sina101.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP