Developer forum

Forum » CMS - Standard features » Backend start page incorrecly redirecting for groups

Backend start page incorrecly redirecting for groups

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

When I have a frontend start page set for a user group, the redirect doesn't work when you're not in the root. For example  when I log in from /products, it tries to take me to /products/Default.aspx?ID=123 instead of /Default.aspx?ID=123

I think the issue is in Security.vb. For the start page of the user, there's the following code:

If Not Text.RegularExpressions.Regex.IsMatch(varAccessUserRedirectOnLogin, "^([a-z]+:)?/+", Text.RegularExpressions.RegexOptions.IgnoreCase) Then
    varAccessUserRedirectOnLogin = "/" + varAccessUserRedirectOnLogin
End If
HttpContext.Current.Response.Redirect(varAccessUserRedirectOnLogin)

This prefixes the URL with a slash when it's not there to send it to the root. For groups, that code doesn't exist:

With cb
    .Add("SELECT [AccessUser].[AccessUserRedirectOnLogin]")
    .Add("FROM [AccessUser]")
    .Add("WHERE ( [AccessUser].[AccessUserID] IN ({0}) )", Base.ChkNumber(DW_extranet_groups.Item(0).ToString))
End With
Dim redirectOnLogin = Database.ExecuteScalar(cb, cnAccess)
If Not IsNothing(redirectOnLogin) Then
    accessUserRedirectOnLogin = redirectOnLogin.ToString()
End If

If accessUserRedirectOnLogin <> "" Then
    HttpContext.Current.Response.Redirect(accessUserRedirectOnLogin)
End If


Could you look into this please? And while you're at it, could you also look at this request that suggests to only look at groups that actually have a redirect URL set: http://developer.dynamicweb.com/forum/development/rediret-on-login-for-user-groups.aspx?PID=48

Thanks,

Imar


Replies

 
Oleg Rodionov
Reply

Hi Imar,

I was not able to reproduce the issue on our test environment, although I'm agree that the code is not fully correct in the case. Please, have a look at http://screencast.com/t/bPqZrlI1iBfC to comment the scenario if it's not fully right. After that I'll create either new TFS bug or backlog item to fix the issue and the demand regarding http://developer.dynamicweb.com/forum/development/rediret-on-login-for-user-groups.aspx?PID=48 as well.

BR, Oleg QA

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Could it be that it happens during auto logon? Here's what I am seeing:

  1. Log in from the homepage. I check Remember me. I get redirected to the proper page.
  2. Browse the site and let it get idle on the group's homepage (in my case, I am developing custom functionality causing IIS to recycle.)
  3. After a while, I refresh the page. Instead of the same page, I get a 404 for /something/homepageforgroup.aspx which should have been /homepageforgroup.aspx

It seems that it's doing this when the user is automatically logged on again.

Does this help?

Imar

 
Oleg Rodionov
Reply

New TFS 25527 has been submitted to fix the both issues, will be fixed on nearest hotfix/release. Thanks for observing.

BR, Oleg QA

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Oleg,

Great, thanks for getting that onto the backlog. Did you manage to reproduce the issue with users coming back to the site after their session has expired?

Thanks,

Imar

 
Oleg Rodionov
Reply
This post has been marked as an answer

Hi Imar,

Yep, you're right, now I was able to catch the fault in line with your scenario (even without IIS recycle), thanks for the clarification.

BR, Oleg QA.

 

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Thanks Oleg!

 

You must be logged in to post in the forum