Add last login attempt field
This commit is contained in:
@@ -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}">
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user