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  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Configure It! (...  Preserve Login Parameters
Previous Previous
 
Next Next
New Post 7/11/2006 10:27 AM
User is offline John Hoskins
65 posts
10th Ranked


Preserve Login Parameters 

Preserve Login Parameters - when a user is directed to the login screen, the system needs to retain the original url ( with parameters ) so that it can redirect back after successful login ( especially useful in nested module UIs like Forum )

This does not appear to be working.  When I follow a link which leads to a details page of a module, I am redirected just to the page the module is on the first time the credetial cookie is set.  If I follow the link after that, I go where I expect to go.

Authentication: Network
DNN Version:  4.3.1 Release Candidate (upgrade from 3.2.2)

 
New Post 9/28/2006 5:20 PM
User is offline Steve Sidle
17 posts
10th Ranked


Re: Preserve Login Parameters 

I can't find any information about this feature anywhere, there are 3 posts about this already, wiith no real answers yet.

Does it work?

Where is it?

How can I turn it off and on.

 
New Post 9/29/2006 8:30 AM
User is offline John Hoskins
65 posts
10th Ranked


Re: Preserve Login Parameters 

Not having seen this working in 4.3.5, I implemented a fix myself.  I am using ADSI authentication - I have not mapped out the path for forms based authentication.  Code change in 2 locations:

Record the incoming URL:

HttpModule.Authentication
AuthenticationModule.vb
OnAuthenticateRequest

        Public Sub OnAuthenticateRequest(ByVal s As Object, ByVal e As EventArgs)
            Dim _portalSettings As PortalSettings = Common.GetPortalSettings
            Dim config As Authentication.Configuration = Authentication.Configuration.GetConfig()

            If config.WindowsAuthentication Then
                Dim Request As HttpRequest = HttpContext.Current.Request
                Dim Response As HttpResponse = HttpContext.Current.Response
                Dim authStatus As AuthenticationStatus = AuthenticationController.GetStatus(_portalSettings.PortalId)

                Dim blnWinLogon As Boolean = (Request.RawUrl.ToLower.IndexOf((AUTHENTICATION_LOGON_PAGE).ToLower) > -1)
                Dim blnWinLogoff As Boolean = (authStatus = AuthenticationStatus.WinLogon) AndAlso (Request.RawUrl.ToLower.IndexOf((AUTHENTICATION_LOGOFF_PAGE).ToLower) > -1)

                If (authStatus = AuthenticationStatus.Undefined) Then  'OrElse (blnWinLogon) Then
                    AuthenticationController.SetStatus(_portalSettings.PortalId, AuthenticationStatus.WinProcess)
                    Dim url As String
                    If Request.ApplicationPath = "/" Then
                        url = "/Admin/Security/WindowsSignin.aspx?tabid=" & _portalSettings.ActiveTab.TabID.ToString
                    Else
                        url = Request.ApplicationPath & "/Admin/Security/WindowsSignin.aspx?tabid=" & _portalSettings.ActiveTab.TabID.ToString
                    End If
                    Try
                        Dim refUrl As String = Request.RawUrl
                        Response.Clear()
                        Response.Cookies("DNNReturnTo" & _portalSettings.PortalId.ToString()).Value = refUrl
                        Response.Cookies("DNNReturnTo" & _portalSettings.PortalId.ToString()).Path = "/"
                        Response.Cookies("DNNReturnTo" & _portalSettings.PortalId.ToString()).Expires = DateTime.Now.AddMinutes(2)
                    Catch
                    End Try
                    Response.Redirect(url)
                ElseIf (Not authStatus = AuthenticationStatus.WinLogoff) AndAlso blnWinLogoff Then
                    Dim objAuthentication As New AuthenticationController
                    objAuthentication.AuthenticationLogoff()
                ElseIf (authStatus = AuthenticationStatus.WinLogoff) AndAlso blnWinLogon Then ' has been logoff before
                    AuthenticationController.SetStatus(_portalSettings.PortalId, AuthenticationStatus.Undefined)
                    Response.Redirect(Request.RawUrl)
                End If

            End If

        End Sub

Redirect to captured URL:

DotNetNuke.Library
Components
Authentication
AuthenticationController.vb
AuthenticationLogon

        Public Sub AuthenticationLogon()
            Dim _config As Authentication.Configuration = Authentication.Configuration.GetConfig()
            .......
            .......
            ' does nothing, just to force page to be refreshed
            Dim querystringparams As String = "logon=" & DateTime.Now.Ticks.ToString()
            Dim strURL As String = NavigateURL(_portalSettings.ActiveTab.TabID, "", querystringparams)
            If Not HttpContext.Current.Request.Cookies("DNNReturnTo" + _portalSettings.PortalId.ToString()) Is Nothing Then
                querystringparams = HttpContext.Current.Request.Cookies("DNNReturnTo" + _portalSettings.PortalId.ToString()).Value
                If querystringparams <> "" Then strURL = querystringparams
            End If
            HttpContext.Current.Response.Redirect(strURL, True)

        End Sub

 
New Post 1/3/2007 12:35 PM
User is offline John Hoskins
65 posts
10th Ranked


Re: Preserve Login Parameters - 4.4.0 

Updated for 4.4.0

Record the incoming URL:

HttpModule.Authentication
AuthenticationModule.vb

Public Sub OnAuthenticateRequest(ByVal s As Object, ByVal e As EventArgs)
.....
If (AuthenticationController.GetStatus(_portalSettings.PortalId) = AuthenticationStatus.Undefined) Then  'OrElse (blnWinLogon) Then
    AuthenticationController.SetStatus(_portalSettings.PortalId, AuthenticationStatus.WinProcess)
    Dim url As String
    If Request.ApplicationPath = "/" Then
        url = "/Admin/Security/WindowsSignin.aspx?tabid=" & _portalSettings.ActiveTab.TabID.ToString
    Else
        url = Request.ApplicationPath & "/Admin/Security/WindowsSignin.aspx?tabid=" & _portalSettings.ActiveTab.TabID.ToString
    End If
    Try
        Dim refUrl As String = Request.RawUrl
        Response.Clear()
        Response.Cookies("DNNReturnTo" & _portalSettings.PortalId.ToString()).Value = refUrl
        Response.Cookies("DNNReturnTo" & _portalSettings.PortalId.ToString()).Path = "/"
        Response.Cookies("DNNReturnTo" & _portalSettings.PortalId.ToString()).Expires = DateTime.Now.AddMinutes(2)
    Catch
    End Try
    Response.Redirect(url)
ElseIf ....
......
End Sub

Redirect to captured URL:

DotNetNuke.Library
Components
Authentication
AuthenticationController.vb

 Public Sub AuthenticationLogon()
.....

.....

' params "logon=windows" does nothing, just to force page to be refreshed
'Dim strURL As String = NavigateURL(_portalSettings.ActiveTab.TabID, "", "logon=windows")
'HttpContext.Current.Response.Redirect(strURL, True)
'Updated to redirect to querrystring passed in prior to authentication
Dim querystringparams As String = "logon=" & DateTime.Now.Ticks.ToString()
Dim strURL As String = NavigateURL(_portalSettings.ActiveTab.TabID, "", querystringparams)
If Not HttpContext.Current.Request.Cookies("DNNReturnTo" + _portalSettings.PortalId.ToString()) Is Nothing Then
    querystringparams = HttpContext.Current.Request.Cookies("DNNReturnTo" + _portalSettings.PortalId.ToString()).Value
    If querystringparams <> "" And querystringparams.IndexOf("WindowsSignin.aspx") < 0 Then strURL = querystringparams
End If
HttpContext.Current.Response.Redirect(strURL, True)
End Sub
 
New Post 4/30/2007 7:37 AM
User is offline tony evans
4 posts
10th Ranked


Re: Preserve Login Parameters - 4.4.0 

Hi

Will this code work with DNN 3.3.7?

Cheers

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Configure It! (...  Preserve Login Parameters
 


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.

 


ADefWebserver.com
DotNetNuke® Module Development Help Website
ADefWebserver.com
Get Smarter Mail, SmarterStats, SmarterTickets
Windows mail server, web log analytics, and customer service management software - Free Editions Available!
www.smartertools.com
DotNetNuke Modules, Skins, Training and Consulting
If you want DotNetNuke done right then look no further. Developed Solutions provides module development, skin design, user and developer training and consulting. Based in Adelaide, Australia, we offer our services worldwide.
www.developedsolutions.com.au

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