Add last login attempt field

This commit is contained in:
emeric
2018-09-28 13:42:02 +02:00
parent 995be9470d
commit 1a6b218c77
3 changed files with 16 additions and 0 deletions
+10
View File
@@ -6,6 +6,16 @@
<h2>${title}</h2>
</div>
<div class="form-horizontal">
${<if-has-last-login-attempt>}
<div class="form-group">
<label class="control-label col-sm-2" for="{id:last-login-attempt}">
${tr:Lms.Admin.User.last-login-attempt}
</label>
<div class="col-sm-5">
${last-login-attempt}
</div>
</div>
${</if-has-last-login-attempt>}
${<if-has-login>}
<div class="form-group">
<label class="control-label col-sm-2" for="${id:login}">
+1
View File
@@ -49,6 +49,7 @@
<message id="Lms.Admin.User.demo-account">Demo account</message>
<message id="Lms.Admin.User.demo-account-already-exists">Demo account already exists!</message>
<message id="Lms.Admin.User.demo-password-invalid">Demo password must be the login name!</message>
<message id="Lms.Admin.User.last-login-attempt">Last login attempt</message>
<message id="Lms.Admin.User.user-already-exists">User already exists!</message>
<message id="Lms.Admin.User.user-create">New user</message>
<message id="Lms.Admin.User.user-created">New user created!</message>
+5
View File
@@ -274,6 +274,11 @@ UserView::refreshView()
auto authUser = LmsApp->getDb().getUserDatabase().findWithId( std::to_string(*userId) );
auto name = authUser.identity(Wt::Auth::Identity::LoginName);
t->bindString("title", Wt::WString::tr("Lms.Admin.User.user-edit").arg(name), Wt::TextFormat::Plain);
t->setCondition("if-has-last-login-attempt", true);
Wt::WLineEdit *lastLoginAttempt = t->bindNew<Wt::WLineEdit>("last-login-attempt");
lastLoginAttempt->setText(authUser.lastLoginAttempt().toString());
lastLoginAttempt->setEnabled(false);
}
else
{