bllue78
  • Posts: 2
  • Joined: 15/03/2013
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!

bllue78
  • Posts: 2
  • Joined: 15/03/2013
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ļ¼Ÿ
Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved