42 """ |
42 """ |
43 enable = True |
43 enable = True |
44 error = "" |
44 error = "" |
45 if self.currentPasswordEdit.isEnabled(): |
45 if self.currentPasswordEdit.isEnabled(): |
46 from Utilities.crypto.py3PBKDF2 import verifyPassword |
46 from Utilities.crypto.py3PBKDF2 import verifyPassword |
47 enable = \ |
47 enable = verifyPassword( |
48 verifyPassword(self.currentPasswordEdit.text(), self.__oldPasswordHash) |
48 self.currentPasswordEdit.text(), self.__oldPasswordHash) |
49 if not enable: |
49 if not enable: |
50 error = error or self.trUtf8("Wrong password entered.") |
50 error = error or self.trUtf8("Wrong password entered.") |
51 |
51 |
52 if self.newPasswordEdit.text() == "": |
52 if self.newPasswordEdit.text() == "": |
53 enable = False |
53 enable = False |
59 error = error or self.trUtf8("Repeated password is wrong.") |
59 error = error or self.trUtf8("Repeated password is wrong.") |
60 |
60 |
61 if self.currentPasswordEdit.isEnabled(): |
61 if self.currentPasswordEdit.isEnabled(): |
62 if self.newPasswordEdit.text() == self.currentPasswordEdit.text(): |
62 if self.newPasswordEdit.text() == self.currentPasswordEdit.text(): |
63 enable = False |
63 enable = False |
64 error = error or self.trUtf8("Old and new password must not be the same.") |
64 error = error or \ |
|
65 self.trUtf8("Old and new password must not be the same.") |
65 |
66 |
66 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) |
67 self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable) |
67 self.errorLabel.setText(error) |
68 self.errorLabel.setText(error) |
68 |
69 |
69 @pyqtSlot(str) |
70 @pyqtSlot(str) |