YAFLogo

bllue78
  • bllue78
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
2013-05-08T04:41:47Z
I'm using YAF version 1.9.6.1 currently and getting some very strange issue on suspending user.

When I suspended the user 2 minutes it shows for example:

User Suspension Ends: Wednesday, May 08, 2013 1:22:39 PM

When I try to login with the suspended user after 2 minutes it gives me following message:

Suspended

Your account has been temporarily suspended. This suspension is due to end on Wednesday, May 08, 2013 1:26:50 PM.

it actually added 2 minutes on top of current time which means user will be suspended forever!

The suspension time on suspend message keeping change everytime I refresh it and every time it adds 2 minutes on top of current time.

I've searched the forum but unfortunately it looks only me got this issue.

Any idea on this issue? Thanks!

Sponsor
bllue78
  • bllue78
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
2013-05-17T05:50:41Z
Eventually I found the root:

in YAF.Core\Context\UserPageBase.cs Line 560

public DateTime SuspendedUntil

{

get

{

return this.Page == null || this.Page["Suspended"] != null

? DateTime.UtcNow

: Convert.ToDateTime(this.Page["Suspended"]);

}

}

Compare to 1.9.5

public DateTime SuspendedUntil

{

get

{

if (Page == null || Page["Suspended"] == DBNull.Value)

{

return DateTime.UtcNow;

}

else

{

return Convert.ToDateTime(Page["Suspended"]);

}

}

}

The logic to determine suspend time is wrong.

When I change to

return this.Page == null || this.Page["Suspended"] == null

? DateTime.UtcNow

: Convert.ToDateTime(this.Page["Suspended"]);

It shows the correct suspend expire time but I got werid problem when user login after suspend time:

The webpage is reporting following error message:

Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

The suspend time has been cleared but when it comes to

HttpContext.Current.Response.Redirect(General.GetSafeRawUrl());

It goes into a infinite redirect loop.

Any ideaļ¼Ÿ