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:
parent
19f5d28eaa
commit
644c7eefd1
@ -155,10 +155,11 @@ namespace Teknik.Areas.Users.Controllers
|
|||||||
{
|
{
|
||||||
user.HashedPassword = SHA384.Hash(model.Username, model.Password);
|
user.HashedPassword = SHA384.Hash(model.Username, model.Password);
|
||||||
user.TransferAccount = false;
|
user.TransferAccount = false;
|
||||||
|
}
|
||||||
|
user.LastSeen = DateTime.Now;
|
||||||
db.Entry(user).State = EntityState.Modified;
|
db.Entry(user).State = EntityState.Modified;
|
||||||
db.SaveChanges();
|
db.SaveChanges();
|
||||||
}
|
HttpCookie authcookie = UserHelper.CreateAuthCookie(model.Username, model.RememberMe, Request.Url.Host.GetDomain(), Request.IsLocal);
|
||||||
HttpCookie authcookie = Utility.UserHelper.CreateAuthCookie(model.Username, model.RememberMe, Request.Url.Host.GetDomain(), Request.IsLocal);
|
|
||||||
Response.Cookies.Add(authcookie);
|
Response.Cookies.Add(authcookie);
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(model.ReturnUrl))
|
if (string.IsNullOrEmpty(model.ReturnUrl))
|
||||||
|
@ -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>
|
<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)
|
@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))
|
@if (!string.IsNullOrEmpty(pgpFingerprint))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user