Merge pull request #121 from joubertredrat/feature-last-login
Last Login for admin manage your users
This commit is contained in:
commit
1b238fe4d5
5 changed files with 64 additions and 40 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue