1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Merge pull request #121 from joubertredrat/feature-last-login

Last Login for admin manage your users
This commit is contained in:
Lunny Xiao
2016-11-10 17:20:55 +08:00
committed by GitHub
5 changed files with 64 additions and 40 deletions

View File

@@ -127,6 +127,13 @@ func SignInPost(ctx *context.Context, form auth.SignInForm) {
// Clear whatever CSRF has right now, force to generate a new one
ctx.SetCookie(setting.CSRFCookieName, "", -1, setting.AppSubUrl)
// Register last login
u.SetLastLogin()
if err := models.UpdateUser(u); err != nil {
ctx.Handle(500, "UpdateUser", err)
return
}
if redirectTo, _ := url.QueryUnescape(ctx.GetCookie("redirect_to")); len(redirectTo) > 0 {
ctx.SetCookie("redirect_to", "", -1, setting.AppSubUrl)
ctx.Redirect(redirectTo)