Index: sources/gui/qml/pages/settings/SettingsServicePassword.qml =================================================================== diff -u -r934354462a353ff5e7fc2ddfe6f3a8f0121a8f3f -r88a09dc4b26cfdd5fd111d20adfb9cb60697186c --- sources/gui/qml/pages/settings/SettingsServicePassword.qml (.../SettingsServicePassword.qml) (revision 934354462a353ff5e7fc2ddfe6f3a8f0121a8f3f) +++ sources/gui/qml/pages/settings/SettingsServicePassword.qml (.../SettingsServicePassword.qml) (revision 88a09dc4b26cfdd5fd111d20adfb9cb60697186c) @@ -47,12 +47,6 @@ // if not accepted return if ( ! isPassword_Accepted ) return - // if accepted save the password - if ( passwordChangeMode ) vSettings.updateServicePassword(passwordUpdated) - - // ask HD to go to service mode - vAdjustmentServiceMode.doAdjustment() - // clear the screen _root.notificationText = "" clearPasswords() @@ -64,15 +58,27 @@ if ( vTDOpMode.service ) gotoServiceMode(true) } - // TODO: Add logic here to check for which user is trying to log in function checkPassword() { - if ( ! vSettings.isServicePasswordMatch( passwordCurrent ) ) { _root.notificationText = qsTr("Incorrect password" ); return false } + let servicePasswordCheck = false + let user1PasswordCheck = false // does nothing right now - if ( ! passwordChangeMode ) { _root.notificationText = "" ; return true } + if ( vSettings.isServicePasswordMatch( passwordCurrent ) || passwordChangeMode ){ handleServicePassword(); servicePasswordCheck = true } - if ( passwordConfirm != passwordUpdated ) { _root.notificationText = qsTr("Mismatch Passwords" ); return false } - if ( ! vSettings.isPasswordValid(passwordUpdated ) ) { _root.notificationText = qsTr("Invalid Password" ); return false } + // TODO: Add other password match checks for other users +// if ( vSettings.isUser1PasswordMatch( passwordCurrent ) || passwordChangeMode ){ handleUser1Password(); user1PasswordCheck = true } - _root.notificationText = "" ; return true + // check all password check if any are successful + let allPasswordCheck = servicePasswordCheck || user1PasswordCheck + _root.notificationText = allPasswordCheck ? "" : qsTr("Incorrect password") + + return allPasswordCheck } + + function handleServicePassword() { + // if accepted save the password + if ( passwordChangeMode ) vSettings.updateServicePassword(passwordUpdated) + + // ask TD to go to service mode + vAdjustmentServiceMode.doAdjustment() + } }