User edit dialog completed

This commit is contained in:
Andrew nuark G 2020-12-23 01:03:13 +07:00
parent 3adbef8c08
commit e24554a0a0
11 changed files with 315 additions and 47 deletions

View file

@ -20,6 +20,14 @@ bool user_entity::verify_password(const QString &password) const {
return (this->_pwd_hash == QCryptographicHash::hash(password.toLocal8Bit(), QCryptographicHash::Sha3_256));
}
void user_entity::set_password(const QString &new_password) {
this->_pwd_hash = QCryptographicHash::hash(new_password.toLocal8Bit(), QCryptographicHash::Sha3_256);
}
void user_entity::set_role(UserRole new_role) {
this->_role = new_role;
}
void user_entity::serialize(QDataStream &output) {
output << this->_id << this->_login << this->_role << this->_pwd_hash;
}