This commit is contained in:
@@ -267,6 +267,38 @@ export default {
|
||||
}
|
||||
},
|
||||
///////////////////////////////
|
||||
// Confirm password
|
||||
// (two fields must match)
|
||||
//
|
||||
confirmMatch(vm, refFirst, refSecond) {
|
||||
if (vm.formState.loading) {
|
||||
return false;
|
||||
}
|
||||
var ctrlFirst = getControl(vm, refFirst);
|
||||
if (typeof ctrlFirst == "undefined") {
|
||||
return false;
|
||||
}
|
||||
|
||||
var ctrlSecond = getControl(vm, refSecond);
|
||||
if (typeof ctrlSecond == "undefined") {
|
||||
return false;
|
||||
}
|
||||
var valueFirst = getControlValue(ctrlFirst);
|
||||
var valueSecond = getControlValue(ctrlSecond);
|
||||
|
||||
if (valueFirst != valueSecond) {
|
||||
var err = window.$gz.locale.get("ErrorNoMatch");
|
||||
//Update the form status
|
||||
this.setFormState({
|
||||
vm: vm,
|
||||
valid: false
|
||||
});
|
||||
return err;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
///////////////////////////////
|
||||
// INTEGER IS VALID
|
||||
//
|
||||
integerValid(vm, ref) {
|
||||
|
||||
@@ -145,6 +145,7 @@ export default {
|
||||
"ErrorServerUnresponsive",
|
||||
"ErrorUserNotAuthenticated",
|
||||
"ErrorUserNotAuthorized",
|
||||
"ErrorNoMatch",
|
||||
"DeletePrompt",
|
||||
"AreYouSureUnsavedChanges",
|
||||
"Leave",
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
spellcheck="false"
|
||||
v-focus
|
||||
:label="lt('UserLogin')"
|
||||
:rules="[form().required(this, 'loginName')]"
|
||||
:error-messages="form().serverErrors(this, 'loginName')"
|
||||
ref="loginName"
|
||||
@change="onChange('loginName')"
|
||||
@@ -42,6 +43,7 @@
|
||||
prepend-icon="fa-key"
|
||||
:label="lt('OldPassword')"
|
||||
:type="reveal ? 'text' : 'password'"
|
||||
:rules="[form().required(this, 'oldPassword')]"
|
||||
:error-messages="form().serverErrors(this, 'oldPassword')"
|
||||
ref="oldPassword"
|
||||
@change="onChange('oldPassword')"
|
||||
@@ -57,6 +59,7 @@
|
||||
prepend-icon="fa-key"
|
||||
:label="lt('NewPassword')"
|
||||
:type="reveal ? 'text' : 'password'"
|
||||
:rules="[form().required(this, 'newPassword')]"
|
||||
:error-messages="form().serverErrors(this, 'newPassword')"
|
||||
ref="newPassword"
|
||||
@change="onChange('newPassword')"
|
||||
@@ -72,6 +75,10 @@
|
||||
prepend-icon="fa-key"
|
||||
:label="lt('ConfirmPassword')"
|
||||
:type="reveal ? 'text' : 'password'"
|
||||
:rules="[
|
||||
form().required(this, 'confirmPassword'),
|
||||
form().confirmMatch(this, 'newPassword', 'confirmPassword')
|
||||
]"
|
||||
:error-messages="form().serverErrors(this, 'confirmPassword')"
|
||||
ref="confirmPassword"
|
||||
@change="onChange('confirmPassword')"
|
||||
|
||||
Reference in New Issue
Block a user