mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
DialogEditTrainee (adminMode)
This commit is contained in:
@@ -11,6 +11,8 @@ kanban-plugin: board
|
||||
|
||||
## Completed
|
||||
|
||||
- [ ] Пароли хранить и пересылать в виде Хеша
|
||||
- [ ] Смена пароля админом (или инструктором только для обучаемых). Старый никому не виден (парольная политика)
|
||||
- [ ] Сделать отправку сообщения на Enter
|
||||
- [ ] Введение логина только латиницей и цифрами
|
||||
- [ ] Кнопка открытия Персональной карты обучаемого
|
||||
@@ -54,19 +56,17 @@ kanban-plugin: board
|
||||
## GUI Messenger
|
||||
|
||||
- [ ] Не влазиют слишком большие сообщения
|
||||
- [ ] Не видно новых пришедших сообщений, если выбран другой Юзер
|
||||
|
||||
|
||||
## GUI общие
|
||||
|
||||
- [ ] Унифицировать терминологию
|
||||
- [ ] Текстовый поиск в задачах
|
||||
|
||||
|
||||
## Замечания Кирилл
|
||||
|
||||
- [ ] Создание БД из кода (если нет или слетела)
|
||||
- [ ] Смена пароля админом. Старый никому не виден (парольная политика)
|
||||
- [ ] Пароли хранить и пересылать в виде Хеша
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
#include <QPushButton>
|
||||
#include <QRegExpValidator>
|
||||
|
||||
DialogEditInstructor::DialogEditInstructor(QWidget *parent) :
|
||||
DialogEditInstructor::DialogEditInstructor(bool adminMode, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogEditInstructor),
|
||||
instructorInput(),
|
||||
flNeedHashPassword(false)
|
||||
flNeedHashPassword(false),
|
||||
adminMode(adminMode)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
verify();
|
||||
@@ -23,9 +24,9 @@ DialogEditInstructor::DialogEditInstructor(QWidget *parent) :
|
||||
ui->editLogin->setValidator(new QRegExpValidator(QRegExp("[A-Za-z\\d]+"), this));
|
||||
|
||||
ui->editPassword->setEnabled(false);
|
||||
#ifndef PROJECT_TYPE_DEBUG
|
||||
//#ifndef PROJECT_TYPE_DEBUG
|
||||
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Password);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
ui->btnViewPassword->setEnabled(false);
|
||||
ui->btnChangePassword->setEnabled(false);
|
||||
@@ -61,7 +62,10 @@ void DialogEditInstructor::setInstructor(Instructor instructor)
|
||||
ui->btnViewPassword->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(adminMode)
|
||||
ui->btnChangePassword->setEnabled(true);
|
||||
}
|
||||
|
||||
ui->btnOK->setEnabled(false);
|
||||
}
|
||||
@@ -136,4 +140,6 @@ void DialogEditInstructor::on_btnChangePassword_clicked()
|
||||
|
||||
ui->editPassword->setText("");
|
||||
flNeedHashPassword = true;
|
||||
|
||||
ui->editPassword->setFocus();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class DialogEditInstructor : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogEditInstructor(QWidget *parent = nullptr);
|
||||
explicit DialogEditInstructor(bool adminMode, QWidget *parent = nullptr);
|
||||
~DialogEditInstructor();
|
||||
|
||||
void setInstructor(Instructor instructor);
|
||||
@@ -44,6 +44,8 @@ private:
|
||||
Instructor instructorInput;
|
||||
|
||||
bool flNeedHashPassword;
|
||||
|
||||
bool adminMode;
|
||||
};
|
||||
|
||||
#endif // DIALOGEDITINSTRUCTOR_H
|
||||
|
||||
@@ -292,7 +292,7 @@ bool EditorInstructors::verifyInstructor(Instructor instructor)
|
||||
|
||||
bool EditorInstructors::editInstructor(Instructor instructor, Instructor* instructor_edit)
|
||||
{
|
||||
DialogEditInstructor dlg(this);
|
||||
DialogEditInstructor dlg(adminMode, this);
|
||||
dlg.setWindowFlags(dlg.windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
dlg.setInstructor(instructor);
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
#include <QPushButton>
|
||||
#include <QRegExpValidator>
|
||||
|
||||
DialogEditTrainee::DialogEditTrainee(QWidget *parent) :
|
||||
DialogEditTrainee::DialogEditTrainee(bool adminMode, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DialogEditTrainee),
|
||||
traineeInput(),
|
||||
flNeedHashPassword(false)
|
||||
flNeedHashPassword(false),
|
||||
adminMode(adminMode)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
verify();
|
||||
@@ -23,9 +24,9 @@ DialogEditTrainee::DialogEditTrainee(QWidget *parent) :
|
||||
ui->editLogin->setValidator(new QRegExpValidator(QRegExp("[A-Za-z\\d]+"), this));
|
||||
|
||||
ui->editPassword->setEnabled(false);
|
||||
#ifndef PROJECT_TYPE_DEBUG
|
||||
//#ifndef PROJECT_TYPE_DEBUG
|
||||
ui->editPassword->setEchoMode(QLineEdit::EchoMode::Password);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
ui->btnViewPassword->setEnabled(false);
|
||||
ui->btnChangePassword->setEnabled(false);
|
||||
@@ -55,7 +56,10 @@ void DialogEditTrainee::setTrainee(Trainee trainee)
|
||||
ui->btnViewPassword->setEnabled(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
//if(adminMode)
|
||||
ui->btnChangePassword->setEnabled(true);
|
||||
}
|
||||
|
||||
ui->btnOK->setEnabled(false);
|
||||
}
|
||||
@@ -129,4 +133,6 @@ void DialogEditTrainee::on_btnChangePassword_clicked()
|
||||
|
||||
ui->editPassword->setText("");
|
||||
flNeedHashPassword = true;
|
||||
|
||||
ui->editPassword->setFocus();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class DialogEditTrainee : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DialogEditTrainee(QWidget *parent = nullptr);
|
||||
explicit DialogEditTrainee(bool adminMode, QWidget *parent = nullptr);
|
||||
~DialogEditTrainee();
|
||||
|
||||
void setTrainee(Trainee trainee);
|
||||
@@ -43,6 +43,8 @@ private:
|
||||
Trainee traineeInput;
|
||||
|
||||
bool flNeedHashPassword;
|
||||
|
||||
bool adminMode;
|
||||
};
|
||||
|
||||
#endif // DIALOGEDITTRAINEE_H
|
||||
|
||||
@@ -514,7 +514,7 @@ bool EditorTrainees::editGroup(Group group, Group *group_edit)
|
||||
|
||||
bool EditorTrainees::editTrainee(Trainee trainee, Trainee *trainee_edit)
|
||||
{
|
||||
DialogEditTrainee dlg(this);
|
||||
DialogEditTrainee dlg(adminMode, this);
|
||||
dlg.setWindowFlags(dlg.windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
|
||||
dlg.setTrainee(trainee);
|
||||
|
||||
Reference in New Issue
Block a user