1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Fixed 'LastSeen' not being updated at login.

Added AM/PM to last seen display.
This commit is contained in:
Uncled1023 2016-05-15 23:59:38 -07:00
parent 19f5d28eaa
commit 644c7eefd1
2 changed files with 5 additions and 4 deletions

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))

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))
{