Scippy One wrote
*************************************************************
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
I have just implemented this piece of code and yes it does fix the bug.
HOWEVER, it also seems to have introduced a new one. When a user logs out of the portal, if they log back in straight away they get redirected to the page they were on and not the home page.
Obviously once answer would be to reset the "redirect on Login" switch to the Home page, but I have over 100 child portals and I can't face going through each of these one at time!!!
I need the redirect at logoff for one VERY VERY important customer, but don't want all my other customers compromised by this.
So any ideas how I can get around this?