From 53dfbe39bdc60a54a7f6cd03fb4f4687c7c5d6ac Mon Sep 17 00:00:00 2001
From: desert-sailor <dxwangk@isoftstone.com>
Date: Tue, 11 Apr 2023 10:51:39 +0800
Subject: [PATCH] [PATCH] bugfix for issue:I6QIOR modify passwd no check
 newpassword

---
 .../window/modules/accounts/modifypasswdpage.cpp   | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/frame/window/modules/accounts/modifypasswdpage.cpp b/src/frame/window/modules/accounts/modifypasswdpage.cpp
index ff33149..e2f9d77 100644
--- a/src/frame/window/modules/accounts/modifypasswdpage.cpp
+++ b/src/frame/window/modules/accounts/modifypasswdpage.cpp
@@ -157,6 +157,20 @@ void ModifyPasswdPage::clickSaveBtn()
 {
     //校验输入密码
     if (judgeTextEmpty(m_oldPasswordEdit)) return;
+    if (judgeTextEmpty(m_newPasswordEdit)) return;
+
+    if (m_newPasswordEdit->lineEdit()->text() == m_oldPasswordEdit->lineEdit()->text() ) {
+        m_newPasswordEdit->setAlert(true);
+        m_newPasswordEdit->showAlertMessage(tr("New password should differ from the current one"), m_oldPasswordEdit, 2000);
+        return;
+    }
+
+    if (judgeTextEmpty(m_repeatPasswordEdit)) return;
+    if (m_newPasswordEdit->lineEdit()->text() != m_repeatPasswordEdit->lineEdit()->text()) {
+        m_repeatPasswordEdit->setAlert(true);
+        m_repeatPasswordEdit->showAlertMessage(tr("Passwords do not match"), m_repeatPasswordEdit, 2000);
+        return;
+    }
 
     Q_EMIT requestChangePassword(m_curUser, m_oldPasswordEdit->lineEdit()->text(), m_newPasswordEdit->lineEdit()->text(), m_repeatPasswordEdit->lineEdit()->text());
 }
-- 
2.33.0

