Commit 1186b7a4 authored by Kevin Whitaker's avatar Kevin Whitaker

Mark a user logged in in DB when successful.

parent cb393b0c
......@@ -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<User>().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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment