mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
Хэширование пароля
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user