pass reset Small fixes (#4310)
This commit is contained in:
parent
7d1f082b27
commit
88a8ee09bd
10 changed files with 34 additions and 36 deletions
|
@ -88,7 +88,7 @@ DlgConnect::DlgConnect(QWidget *parent) : QDialog(parent)
|
|||
|
||||
btnForgotPassword = new QPushButton(this);
|
||||
btnForgotPassword->setIcon(QPixmap("theme:icons/forgot_password"));
|
||||
btnForgotPassword->setToolTip(tr("Forgot Password"));
|
||||
btnForgotPassword->setToolTip(tr("Reset Password"));
|
||||
btnForgotPassword->setFixedWidth(30);
|
||||
connect(btnForgotPassword, SIGNAL(released()), this, SLOT(actForgotPassword()));
|
||||
|
||||
|
|
|
@ -27,9 +27,8 @@ DlgForgotPasswordChallenge::DlgForgotPasswordChallenge(QWidget *parent) : QDialo
|
|||
}
|
||||
|
||||
if (servers.getFPHostname().isEmpty() && servers.getFPPort().isEmpty() && servers.getFPPlayerName().isEmpty()) {
|
||||
QMessageBox::warning(this, tr("Forgot Password Challenge Warning"),
|
||||
tr("Oops, looks like something has gone wrong. Please restart the forgot password "
|
||||
"process by using the forgot password button on the connection screen."));
|
||||
QMessageBox::warning(this, tr("Reset Password Challenge Warning"),
|
||||
tr("A problem has occurred. Please try to request a new password again."));
|
||||
reject();
|
||||
}
|
||||
|
||||
|
@ -82,7 +81,7 @@ DlgForgotPasswordChallenge::DlgForgotPasswordChallenge(QWidget *parent) : QDialo
|
|||
mainLayout->addWidget(buttonBox);
|
||||
setLayout(mainLayout);
|
||||
|
||||
setWindowTitle(tr("Forgot Password Challenge"));
|
||||
setWindowTitle(tr("Reset Password Challenge"));
|
||||
setFixedHeight(sizeHint().height());
|
||||
setMinimumWidth(300);
|
||||
}
|
||||
|
@ -90,7 +89,7 @@ DlgForgotPasswordChallenge::DlgForgotPasswordChallenge(QWidget *parent) : QDialo
|
|||
void DlgForgotPasswordChallenge::actOk()
|
||||
{
|
||||
if (emailEdit->text().isEmpty()) {
|
||||
QMessageBox::critical(this, tr("Forgot Password Challenge Warning"), tr("The email address can't be empty."));
|
||||
QMessageBox::critical(this, tr("Reset Password Challenge Error"), tr("The email address can't be empty."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ DlgForgotPasswordRequest::DlgForgotPasswordRequest(QWidget *parent) : QDialog(pa
|
|||
mainLayout->addWidget(buttonBox);
|
||||
setLayout(mainLayout);
|
||||
|
||||
setWindowTitle(tr("Forgot Password Request"));
|
||||
setWindowTitle(tr("Reset Password Request"));
|
||||
setFixedHeight(sizeHint().height());
|
||||
setMinimumWidth(300);
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ DlgForgotPasswordRequest::DlgForgotPasswordRequest(QWidget *parent) : QDialog(pa
|
|||
void DlgForgotPasswordRequest::actOk()
|
||||
{
|
||||
if (playernameEdit->text().isEmpty()) {
|
||||
QMessageBox::critical(this, tr("Forgot Password Request Warning"), tr("The player name can't be empty."));
|
||||
QMessageBox::critical(this, tr("Reset Password Error"), tr("The player name can't be empty."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,9 +27,8 @@ DlgForgotPasswordReset::DlgForgotPasswordReset(QWidget *parent) : QDialog(parent
|
|||
}
|
||||
|
||||
if (servers.getFPHostname().isEmpty() && servers.getFPPort().isEmpty() && servers.getFPPlayerName().isEmpty()) {
|
||||
QMessageBox::warning(this, tr("Forgot Password Reset Warning"),
|
||||
tr("Oops, looks like something has gone wrong. Please re-start the forgot password "
|
||||
"process by using the forgot password button on the connection screen."));
|
||||
QMessageBox::warning(this, tr("Reset Password Warning"),
|
||||
tr("A problem has occurred. Please try to request a new password again."));
|
||||
reject();
|
||||
}
|
||||
|
||||
|
@ -95,7 +94,7 @@ DlgForgotPasswordReset::DlgForgotPasswordReset(QWidget *parent) : QDialog(parent
|
|||
mainLayout->addWidget(buttonBox);
|
||||
setLayout(mainLayout);
|
||||
|
||||
setWindowTitle(tr("Forgot Password Reset"));
|
||||
setWindowTitle(tr("Reset Password"));
|
||||
setFixedHeight(sizeHint().height());
|
||||
setMinimumWidth(300);
|
||||
}
|
||||
|
@ -103,22 +102,22 @@ DlgForgotPasswordReset::DlgForgotPasswordReset(QWidget *parent) : QDialog(parent
|
|||
void DlgForgotPasswordReset::actOk()
|
||||
{
|
||||
if (playernameEdit->text().isEmpty()) {
|
||||
QMessageBox::critical(this, tr("Forgot Password Reset Warning"), tr("The player name can't be empty."));
|
||||
QMessageBox::critical(this, tr("Reset Password Error"), tr("The player name can't be empty."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (tokenEdit->text().isEmpty()) {
|
||||
QMessageBox::critical(this, tr("Forgot Password Reset Warning"), tr("The token can't be empty."));
|
||||
QMessageBox::critical(this, tr("Reset Password Error"), tr("The token can't be empty."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (newpasswordEdit->text().isEmpty()) {
|
||||
QMessageBox::critical(this, tr("Forgot Password Reset Warning"), tr("The new password can't be empty."));
|
||||
QMessageBox::critical(this, tr("Reset Password Error"), tr("The new password can't be empty."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (newpasswordEdit->text() != newpasswordverifyEdit->text()) {
|
||||
QMessageBox::critical(this, tr("Forgot Password Reset Warning"), tr("The passwords do not match."));
|
||||
QMessageBox::critical(this, tr("Reset Password Error"), tr("The passwords do not match."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
|
|||
labNotes->setWordWrap(true);
|
||||
labNotes->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||
labNotes->setOpenExternalLinks(true);
|
||||
labNotes->setText(tr("Use ctrl+a to select all sets in the view.") + "<br><b>" + tr("Deck Editor") + ":</b> " +
|
||||
labNotes->setText(tr("Use CTRL+A to select all sets in the view.") + "<br><b>" + tr("Deck Editor") + ":</b> " +
|
||||
tr("Only cards in enabled sets will appear in the card list of the deck editor.") + "<br><b>" +
|
||||
tr("Card Art") + ":</b> " + tr("Image priority is decided in the following order:") + "<br>" +
|
||||
tr("first the CUSTOM Folder (%1), then the Enabled Sets in this dialog (Top to Bottom)",
|
||||
|
|
|
@ -1321,7 +1321,7 @@ void MainWindow::actForgotPasswordRequest()
|
|||
void MainWindow::forgotPasswordSuccess()
|
||||
{
|
||||
QMessageBox::information(
|
||||
this, tr("Forgot Password"),
|
||||
this, tr("Reset Password"),
|
||||
tr("Your password has been reset successfully, you can now log in using the new credentials."));
|
||||
SettingsCache::instance().servers().setFPHostName("");
|
||||
SettingsCache::instance().servers().setFPPort("");
|
||||
|
@ -1331,7 +1331,7 @@ void MainWindow::forgotPasswordSuccess()
|
|||
void MainWindow::forgotPasswordError()
|
||||
{
|
||||
QMessageBox::warning(
|
||||
this, tr("Forgot Password"),
|
||||
this, tr("Reset Password"),
|
||||
tr("Failed to reset user account password, please contact the server operator to reset your password."));
|
||||
SettingsCache::instance().servers().setFPHostName("");
|
||||
SettingsCache::instance().servers().setFPPort("");
|
||||
|
@ -1340,7 +1340,7 @@ void MainWindow::forgotPasswordError()
|
|||
|
||||
void MainWindow::promptForgotPasswordReset()
|
||||
{
|
||||
QMessageBox::information(this, tr("Forgot Password"),
|
||||
QMessageBox::information(this, tr("Reset Password"),
|
||||
tr("Activation request received, please check your email for an activation token."));
|
||||
DlgForgotPasswordReset dlg(this);
|
||||
if (dlg.exec()) {
|
||||
|
|
|
@ -166,27 +166,27 @@ minpasswordlength = 6
|
|||
|
||||
[forgotpassword]
|
||||
|
||||
; Servatrice can process forgot password requests allowing users to reset their account
|
||||
; Servatrice can process reset password requests allowing users to reset their account
|
||||
; passwords in the event they forget it. Should this feature be enabled? Default: false.
|
||||
; enable=false
|
||||
|
||||
; Forgot password request should not be allowed to stay valid forever. This settings
|
||||
; informs servatrice how long a players forgot password reset token is valid for (in minutes).
|
||||
; Reset password request should not be allowed to stay valid forever. This settings
|
||||
; informs servatrice how long a players reset password reset token is valid for (in minutes).
|
||||
; Default: 60
|
||||
; tokenlife=60
|
||||
|
||||
; Servatrice can challenge users that are making forgot password requests to answer
|
||||
; Servatrice can challenge users that are making reset password requests to answer
|
||||
; questions in regards to their account to help validate they are the true owner of the account.
|
||||
; Should this feature be enabled? Default: false
|
||||
; enablechallenge=false
|
||||
|
||||
; Email subject for the forgot password emails
|
||||
; subject="Cockatrice forgot password token"
|
||||
; Email subject for the reset password emails
|
||||
; subject="Cockatrice reset password token"
|
||||
|
||||
; Forgot password email body. You can use these tags here: %username %token
|
||||
; Reset password email body. You can use these tags here: %username %token
|
||||
; They will be substituted with the actual values in the email
|
||||
;
|
||||
; body="Hi %username, sorry to hear you forgot your password on our Cockatrice server\r\nHere's the token to use to reset your account password:\r\n\r\n%token\r\n\r\nHappy gaming!"
|
||||
; body="Hi %username,\r\nthanks for reaching out to us with your password reset request for our Cockatrice server.\r\nHere's your unique token in order to reset your account password in the app:\r\n\r\n%token\r\n\r\nHappy gaming!"
|
||||
|
||||
|
||||
[smtp]
|
||||
|
|
|
@ -285,16 +285,16 @@ bool Servatrice::initServer()
|
|||
}
|
||||
}
|
||||
|
||||
qDebug() << "Forgot password enabled: " << getEnableForgotPassword();
|
||||
qDebug() << "Reset password enabled: " << getEnableForgotPassword();
|
||||
if (getEnableForgotPassword()) {
|
||||
qDebug() << "Forgot password token life (in minutes): " << getForgotPasswordTokenLife();
|
||||
qDebug() << "Forgot password challenge on: " << getEnableForgotPasswordChallenge();
|
||||
qDebug() << "Reset password token life (in minutes): " << getForgotPasswordTokenLife();
|
||||
qDebug() << "Reset password challenge on: " << getEnableForgotPasswordChallenge();
|
||||
}
|
||||
|
||||
qDebug() << "Auditing enabled: " << getEnableAudit();
|
||||
if (getEnableAudit()) {
|
||||
qDebug() << "Audit registration attempts enabled: " << getEnableRegistrationAudit();
|
||||
qDebug() << "Audit forgot password attepts enabled: " << getEnableForgotPasswordAudit();
|
||||
qDebug() << "Audit reset password attepts enabled: " << getEnableForgotPasswordAudit();
|
||||
}
|
||||
|
||||
if (getDBTypeString() == "mysql") {
|
||||
|
|
|
@ -1249,7 +1249,7 @@ Response::ResponseCode AbstractServerSocketInterface::cmdAccountPassword(const C
|
|||
Response::ResponseCode AbstractServerSocketInterface::cmdForgotPasswordRequest(const Command_ForgotPasswordRequest &cmd,
|
||||
ResponseContainer &rc)
|
||||
{
|
||||
qDebug() << "Received forgot password request from user: " << QString::fromStdString(cmd.user_name());
|
||||
qDebug() << "Received reset password request from user: " << QString::fromStdString(cmd.user_name());
|
||||
|
||||
if (!servatrice->getEnableForgotPassword()) {
|
||||
if (servatrice->getEnableForgotPasswordAudit())
|
||||
|
@ -1327,7 +1327,7 @@ Response::ResponseCode AbstractServerSocketInterface::cmdForgotPasswordReset(con
|
|||
ResponseContainer &rc)
|
||||
{
|
||||
Q_UNUSED(rc);
|
||||
qDebug() << "Received forgot password reset from user: " << QString::fromStdString(cmd.user_name());
|
||||
qDebug() << "Received reset password reset from user: " << QString::fromStdString(cmd.user_name());
|
||||
|
||||
if (!sqlInterface->doesForgotPasswordExist(QString::fromStdString(cmd.user_name()))) {
|
||||
if (servatrice->getEnableForgotPasswordAudit())
|
||||
|
@ -1367,7 +1367,7 @@ AbstractServerSocketInterface::cmdForgotPasswordChallenge(const Command_ForgotPa
|
|||
ResponseContainer &rc)
|
||||
{
|
||||
Q_UNUSED(rc);
|
||||
qDebug() << "Received forgot password challenge from user: " << QString::fromStdString(cmd.user_name());
|
||||
qDebug() << "Received reset password challenge from user: " << QString::fromStdString(cmd.user_name());
|
||||
|
||||
if (sqlInterface->doesForgotPasswordExist(QString::fromStdString(cmd.user_name()))) {
|
||||
if (servatrice->getEnableForgotPasswordAudit())
|
||||
|
|
|
@ -63,7 +63,7 @@ To learn React, check out the [React documentation](https://reactjs.org/).
|
|||
|
||||
6) Account page
|
||||
|
||||
7) Register/Forgot Passoword forms
|
||||
7) Register/Reset Password forms
|
||||
|
||||
8) Message User
|
||||
|
||||
|
|
Loading…
Reference in a new issue