mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 22:15:51 +01:00
Add AccountService#updateLastLoginDate().
This commit is contained in:
@@ -24,6 +24,7 @@ trait SignInControllerBase extends ControllerBase { self: AccountService =>
|
||||
redirect("/signin")
|
||||
} else {
|
||||
session.setAttribute("LOGIN_ACCOUNT", account.get)
|
||||
updateLastLoginDate(account.get.userName)
|
||||
redirect("/%s".format(account.get.userName))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,14 @@ trait AccountService {
|
||||
account.lastLoginDate)
|
||||
}
|
||||
|
||||
def updateLastLoginDate(userName: String): Unit = {
|
||||
val q = for {
|
||||
a <- Accounts if a.userName is userName.bind
|
||||
} yield a.lastLoginDate
|
||||
|
||||
q.update(new java.sql.Date(System.currentTimeMillis))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
object AccountService {
|
||||
|
||||
Reference in New Issue
Block a user