Browse Source

Fixed 'LastSeen' not being updated at login.

Added AM/PM to last seen display.
tags/2.0.3
Teknikode 4 years ago
parent
commit
644c7eefd1

+ 4
- 3
Teknik/Areas/User/Controllers/UserController.cs View File

@@ -155,10 +155,11 @@ namespace Teknik.Areas.Users.Controllers
{
user.HashedPassword = SHA384.Hash(model.Username, model.Password);
user.TransferAccount = false;
db.Entry(user).State = EntityState.Modified;
db.SaveChanges();
}
HttpCookie authcookie = Utility.UserHelper.CreateAuthCookie(model.Username, model.RememberMe, Request.Url.Host.GetDomain(), Request.IsLocal);
user.LastSeen = DateTime.Now;
db.Entry(user).State = EntityState.Modified;
db.SaveChanges();
HttpCookie authcookie = UserHelper.CreateAuthCookie(model.Username, model.RememberMe, Request.Url.Host.GetDomain(), Request.IsLocal);
Response.Cookies.Add(authcookie);

if (string.IsNullOrEmpty(model.ReturnUrl))

+ 1
- 1
Teknik/Areas/User/Views/User/Index.cshtml View File

@@ -73,7 +73,7 @@
<li class="list-group-item text-right"><span class="pull-left"><strong>Joined</strong></span> <time datetime="@Model.LastSeen.ToString("o")">@Model.JoinDate.ToString("MMMM dd, yyyy")</time></li>
@if (OwnProfile && User.Identity.IsAuthenticated)
{
<li class="list-group-item text-right"><span class="pull-left"><strong>Last Seen</strong></span> <time datetime="@Model.LastSeen.ToString("o")">@Model.LastSeen.ToString("MMMM dd, yyyy hh:mm:ss")</time></li>
<li class="list-group-item text-right"><span class="pull-left"><strong>Last Seen</strong></span> <time datetime="@Model.LastSeen.ToString("o")">@Model.LastSeen.ToString("MMMM dd, yyyy hh:mm tt")</time></li>
}
@if (!string.IsNullOrEmpty(pgpFingerprint))
{

Loading…
Cancel
Save