diff --git a/src/ui/LoginInterface.cpp b/src/ui/LoginInterface.cpp index 97b811b96023dff4e81ab83fe724f92327a9725d..8fa712600e1c1ad610c6decabab1c8a560cd4183 100644 --- a/src/ui/LoginInterface.cpp +++ b/src/ui/LoginInterface.cpp @@ -106,6 +106,14 @@ void LoginInterface::loginCheck() Wt::log("info") << "login by "<< app->currentUser.username << " happened."; setLocalCookieForUser(app->currentUser); app->loginCompleted(); + //Now mark this as a successful login. + Wt::Dbo::Transaction loginTransaction(sqlSession); + UserAction* action = new UserAction(); + action->action = UserAction::UAction::Login; + action->user = sqlSession.find().where("username = ?").bind(app->currentUser.username); + action->datetime = Wt::WDateTime::currentDateTime(); + sqlSession.add(action); + loginTransaction.commit(); } //If credentials don't match, reject user with message saying crednetials are wrong and they can ask an admin to make them an account. else