mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 06:25:51 +01:00
Add AccountService#updateLastLoginDate().
This commit is contained in:
@@ -24,6 +24,7 @@ trait SignInControllerBase extends ControllerBase { self: AccountService =>
|
|||||||
redirect("/signin")
|
redirect("/signin")
|
||||||
} else {
|
} else {
|
||||||
session.setAttribute("LOGIN_ACCOUNT", account.get)
|
session.setAttribute("LOGIN_ACCOUNT", account.get)
|
||||||
|
updateLastLoginDate(account.get.userName)
|
||||||
redirect("/%s".format(account.get.userName))
|
redirect("/%s".format(account.get.userName))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,14 @@ trait AccountService {
|
|||||||
account.lastLoginDate)
|
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 {
|
object AccountService {
|
||||||
|
|||||||
Reference in New Issue
Block a user