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