Хэширование пароля

This commit is contained in:
2025-10-16 17:11:58 +03:00
parent 8e931f229b
commit 241382d305
19 changed files with 221 additions and 116 deletions

View File

@@ -47,59 +47,17 @@ void EditorInstructors::on_btnNewInstructor_clicked()
Instructor instructor;
Instructor instructor_edit;
instructor.setNeedSetPassword(true);
if(editInstructor(instructor, &instructor_edit))
{
waitAnimationWidget->showWithPlay();
connectorToServer->sendQueryToDB(TypeQueryToDB::TYPE_QUERY_NEW_INSTRUCTOR, 0, &instructor_edit);
}
lastCurrentID = 0;
return;
/*
if(int id_instructor = dbLMS->newInstructor())
{
loadInstructorsFromDB();
setCurrentInstructor(id_instructor);
DialogEditInstructor dlg(this);
Instructor instructor = dbLMS->getInstructor(id_instructor);
if(instructor.getID() == 0)
return;
dlg.setInstructor(instructor);
while (true)
{
switch( dlg.exec() )
{
case QDialog::Accepted:
{
Instructor instructor_edit = dlg.getInstructor();
if(int id_edit = dbLMS->editInstructor(instructor_edit))
{//Отредактировано
loadInstructorsFromDB();
setCurrentInstructor(id_edit);
return;
}
else
{
dlg.setInstructor(instructor_edit);
continue;
}
}
case QDialog::Rejected:
dbLMS->delInstructor(id_instructor);
loadInstructorsFromDB();
return;
default:
dbLMS->delInstructor(id_instructor);
loadInstructorsFromDB();
return;
}
}
}
*/
}
void EditorInstructors::on_btnDeleteInstructor_clicked()
@@ -353,6 +311,13 @@ bool EditorInstructors::editInstructor(Instructor instructor, Instructor* instru
continue;
}
if(instructor_edit->getNeedSetPassword())
{
//Хэшируем пароль
instructor_edit->hashingPassword();
instructor_edit->setNeedSetPassword(false);
}
return true;
}
case QDialog::Rejected: