Adding User edit/create view

This commit is contained in:
emeric
2018-04-10 13:24:14 +02:00
parent 05fd8a47d8
commit 2f7697d278
21 changed files with 510 additions and 64 deletions
+13 -14
View File
@@ -57,20 +57,8 @@ Auth::Auth(Wt::WContainerWidget *parent)
auto loginBtn = new Wt::WPushButton(Wt::WString::tr("Lms.login"));
bindWidget("login-btn", loginBtn);
loginBtn->clicked().connect(std::bind([=]
{
updateModel(_model);
if (_model->validate())
_model->login(DbHandler().getLogin());
else
updateView(_model);
}));
password->enterPressed().connect(std::bind([=]
{
loginBtn->clicked().emit(Wt::WMouseEvent());
}));
loginBtn->clicked().connect(this, &Auth::processAuth);
password->enterPressed().connect(this, &Auth::processAuth);
DbHandler().getLogin().changed().connect(std::bind([=]
{
@@ -84,6 +72,17 @@ Auth::Auth(Wt::WContainerWidget *parent)
updateView(_model);
}
void
Auth::processAuth()
{
updateModel(_model);
if (_model->validate())
_model->login(DbHandler().getLogin());
else
updateView(_model);
}
void
Auth::logout()
{