Implemented application login.

Minor UI improvement.
Fixed memory leaks.
This commit is contained in:
2016-02-09 10:04:17 +01:00
parent 3d68281c87
commit c722fe743c
24 changed files with 455 additions and 33 deletions
+3 -2
View File
@@ -5,9 +5,9 @@
#include <QHeaderView>
#include "../data/core-data.h"
#include "../service.h"
#include "../permissionservice.h"
#include "../emptystringvalidator.h"
#include "../samestringvalidator.h"
#include <QCryptographicHash>
UserForm::UserForm(QWidget *parent) :
AutoForm<User>(parent),
@@ -69,8 +69,9 @@ bool UserForm::bindOtherToData()
this->entity()->addRole(srv.loadById(ui->tableWidget->item(i,0)->data(Qt::UserRole).toInt()));
}
}
PermissionService permService;
if (m_passChanged){
this->entity()->setPassword(QString(QCryptographicHash::hash(ui->password->text().toUtf8(),QCryptographicHash::Sha256).toBase64()));
this->entity()->setPassword(permService.encryptPassword(ui->password->text()));
}
return true;
}