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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Redirect after Logout no longer works in 4.8.2Redirect after Logout no longer works in 4.8.2
Previous
 
Next
New Post
5/22/2008 10:25 AM
 

Ok, I'll ask the obvious question.  When will it be fixed?  This is a pretty important function.

 
New Post
5/22/2008 10:55 AM
 

Is someone submitting a bug report on this?  I have another issue that is related to this.  The logoff page does not redirect you to the home page properly because the logic in the following code in the AuthenticationController.vb file has some logic issues.  The issue is that if I login, then go to say an About Us page that has all user access, and then log off while on the About Us page, it will stay at that page and not redirect me to the redirect page I set in the user settings page (under the admin/user authentication section).  I don't think this is expected behavior.  A quick workaround that doesn't require recompiling this module is to make all pages with "All Users" to be marked with Unathenticated User and Registered Users instead of All Users.  Otherwise a more permanant fix is to change the code in the module.  I have identified the offending line of code.

   Public Shared Function GetLogoffRedirectURL(ByVal settings As PortalSettings, ByVal request As HttpRequest) As String
            Dim _RedirectURL As String = ""
 
            ' check if anonymous users have access to the current page
            If settings.ActiveTab.AuthorizedRoles.IndexOf(";" & glbRoleAllUsersName & ";") <> -1 Then
                ' redirect to current page
                _RedirectURL = NavigateURL(settings.ActiveTab.TabID)
            Else ' redirect to a different page
                Dim setting As Object = UserModuleBase.GetSetting(settings.PortalId, "Redirect_AfterLogout")
 
                If CType(setting, Integer) = Null.NullInteger Then
                    If settings.HomeTabId <> -1 Then
                        ' redirect to portal home page specified
                        _RedirectURL = NavigateURL(settings.HomeTabId)
                    Else ' redirect to default portal root
                        _RedirectURL = GetPortalDomainName(settings.PortalAlias.HTTPAlias, request) & "/" & glbDefaultPage
                    End If
                Else ' redirect to after logout page
                    _RedirectURL = NavigateURL(CType(setting, Integer))
                End If
            End If
 
            Return _RedirectURL
        End Function
 
New Post
5/23/2008 5:28 AM
 

*************************************************************

Well! I've solved the logout issue about DNN 4.8.2 version.

Go under admin\Authentication directory of your DNN installation and open the Logoff.ascx.vb file. Here you must modify the redirect sub in this way:

************************************************************

         Private Sub Redirect()
            ' Redirect browser back to portal logout page
            Response.Redirect(RedirectURL, True)
        End Sub

************************************************************

Then add the redirectURL property (copy and paste below)

*************************************************************

         Protected ReadOnly Property RedirectURL() As String
            Get
                Dim _RedirectURL As String = ""

                Dim setting As Object = UserModuleBase.GetSetting(PortalId, "Redirect_AfterLogout")

                If CType(setting, Integer) = Null.NullInteger Then
                    If Not Request.QueryString("returnurl") Is Nothing Then
                        ' return to the url passed to signin
                        _RedirectURL = HttpUtility.UrlDecode(Request.QueryString("returnurl"))
                        ' redirect url should never contain a protocol ( if it does, it is likely a cross-site request forgery attempt )
                        If _RedirectURL.Contains("://") Then
                            _RedirectURL = ""
                        End If
                    ElseIf PortalSettings.LoginTabId = -1 And PortalSettings.HomeTabId <> -1 Then
                        ' redirect to portal home page specified    
                        _RedirectURL = NavigateURL(PortalSettings.HomeTabId)
                    Else
                        ' redirect to current page
                        _RedirectURL = NavigateURL(Me.TabId)
                    End If
                Else ' redirect to after logout page
                    _RedirectURL = NavigateURL(CType(setting, Integer))
                End If
                'replace language parameter in querystring, to make sure that user will see page in correct language
                If UserId <> -1 Then
                    If User.Profile.PreferredLocale <> CultureInfo.CurrentCulture.Name Then
                        _RedirectURL = UrlUtils.replaceQSParam(_RedirectURL, "language", User.Profile.PreferredLocale)
                    End If
                End If

                'check for insecure account defaults
                Dim qsDelimiter As String = "?"
                If _RedirectURL.Contains("?") Then
                    qsDelimiter = "&"
                End If

                Return _RedirectURL

            End Get
        End Property

 

Now the logout redirect to logout page setted in the user setting or to home page if nothing is setted

 

 
New Post
5/23/2008 7:28 AM
 

Thanks,

This fixed the bug for me.

Best regards,

Duc

 
New Post
5/25/2008 10:55 AM
 

Just to confirm, this works in 4.8.0, so it must have been code changes in the 4.8.1/2 codeline that "unfixed" it.


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Redirect after Logout no longer works in 4.8.2Redirect after Logout no longer works in 4.8.2


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