|
|
|
|
@ -35,71 +35,70 @@ export class ChangePasswordComponent implements OnInit {
|
|
|
|
|
public OLD_PASSWORD: boolean = false;
|
|
|
|
|
|
|
|
|
|
public recentPasswordNote = {
|
|
|
|
|
yellowImg: '../assets/icon/yellow.svg',
|
|
|
|
|
text: 'Do not user recent password.',
|
|
|
|
|
|
|
|
|
|
yellowImg: '../assets/imgs/mohemm-action/info.png',
|
|
|
|
|
text: this.ts.trPK('login', 'current-password-validation')
|
|
|
|
|
};
|
|
|
|
|
public isLowerCase = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'At least one lowercase.',
|
|
|
|
|
text: this.ts.trPK('login', 'lowercase-password-validation'),
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public isUpperCase = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'At least one uppdercase.',
|
|
|
|
|
text: this.ts.trPK('login', 'uppercase-password-validation'),
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public isLetterCase = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'At least one Letter.',
|
|
|
|
|
text: this.ts.trPK('login', 'letter-password-validation'),
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public isHasDigit = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'At least one nomeric.',
|
|
|
|
|
text: this.ts.trPK('login', 'numerica-password-validation'),
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public isMinLength = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'Minimum 8 characters.',
|
|
|
|
|
text: this.ts.trPK('login', 'min-password-validation'),
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public isRepeatedLetter = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'Do not add repeating letters.',
|
|
|
|
|
text: this.ts.trPK('login', 'repeating-password-validation'),
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public isContainSpecialChar = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'It should contain special character.',
|
|
|
|
|
text: this.ts.trPK('login', 'special-character-password-validation'),
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public confirmMatchNew = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'Confirm Password does not match.',
|
|
|
|
|
text: this.ts.trPK('login', 'not-match-password-validation'),
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public userNameMatchNew = {
|
|
|
|
|
blankImg: '../assets/icon/blank.svg',
|
|
|
|
|
greenImg: '../assets/icon/green.svg',
|
|
|
|
|
redImg: '../assets/imgs/close.svg',
|
|
|
|
|
text: 'password should not contain the user name.',
|
|
|
|
|
text: this.ts.trPK('login', 'contain-username-password-validation'),
|
|
|
|
|
isMatch: false
|
|
|
|
|
};
|
|
|
|
|
public userId: string;
|
|
|
|
|
@ -278,62 +277,62 @@ export class ChangePasswordComponent implements OnInit {
|
|
|
|
|
// return this.isUpperCase.redImg;
|
|
|
|
|
// }
|
|
|
|
|
case 1:
|
|
|
|
|
if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
this.isLetterCase.isMatch = true;
|
|
|
|
|
return this.isLetterCase.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isLetterCase.isMatch = false;
|
|
|
|
|
return this.isLetterCase.redImg;
|
|
|
|
|
}
|
|
|
|
|
if (/[a-zA-Z]/.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
this.isLetterCase.isMatch = true;
|
|
|
|
|
return this.isLetterCase.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isLetterCase.isMatch = false;
|
|
|
|
|
return this.isLetterCase.redImg;
|
|
|
|
|
}
|
|
|
|
|
case 3:
|
|
|
|
|
if (/[0-9]/.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
this.isHasDigit.isMatch = true;
|
|
|
|
|
return this.isHasDigit.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isHasDigit.isMatch = false;
|
|
|
|
|
return this.isHasDigit.redImg;
|
|
|
|
|
}
|
|
|
|
|
if (/[0-9]/.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
this.isHasDigit.isMatch = true;
|
|
|
|
|
return this.isHasDigit.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isHasDigit.isMatch = false;
|
|
|
|
|
return this.isHasDigit.redImg;
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
if (this.P_NEW_PASSWORD.length >= 8) {
|
|
|
|
|
this.isMinLength.isMatch = true;
|
|
|
|
|
return this.isMinLength.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isMinLength.isMatch = false;
|
|
|
|
|
return this.isMinLength.redImg;
|
|
|
|
|
}
|
|
|
|
|
if (this.P_NEW_PASSWORD.length >= 8) {
|
|
|
|
|
this.isMinLength.isMatch = true;
|
|
|
|
|
return this.isMinLength.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isMinLength.isMatch = false;
|
|
|
|
|
return this.isMinLength.redImg;
|
|
|
|
|
}
|
|
|
|
|
case 5:
|
|
|
|
|
if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
this.isRepeatedLetter.isMatch = false;
|
|
|
|
|
return this.isRepeatedLetter.redImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isRepeatedLetter.isMatch = true;
|
|
|
|
|
return this.isRepeatedLetter.greenImg;
|
|
|
|
|
}
|
|
|
|
|
if (/([a-z])\1/i.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
this.isRepeatedLetter.isMatch = false;
|
|
|
|
|
return this.isRepeatedLetter.redImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isRepeatedLetter.isMatch = true;
|
|
|
|
|
return this.isRepeatedLetter.greenImg;
|
|
|
|
|
}
|
|
|
|
|
case 6:
|
|
|
|
|
if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
this.isContainSpecialChar.isMatch = true;
|
|
|
|
|
return this.isContainSpecialChar.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isContainSpecialChar.isMatch = false;
|
|
|
|
|
return this.isContainSpecialChar.redImg;
|
|
|
|
|
}
|
|
|
|
|
if (/[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(this.P_NEW_PASSWORD)) {
|
|
|
|
|
this.isContainSpecialChar.isMatch = true;
|
|
|
|
|
return this.isContainSpecialChar.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.isContainSpecialChar.isMatch = false;
|
|
|
|
|
return this.isContainSpecialChar.redImg;
|
|
|
|
|
}
|
|
|
|
|
case 7:
|
|
|
|
|
if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) {
|
|
|
|
|
this.confirmMatchNew.isMatch = false;
|
|
|
|
|
return this.confirmMatchNew.redImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.confirmMatchNew.isMatch = true;
|
|
|
|
|
return this.confirmMatchNew.greenImg;
|
|
|
|
|
}
|
|
|
|
|
if (this.P_NEW_PASSWORD !== this.P_Confirm_NEW_PASSWORD) {
|
|
|
|
|
this.confirmMatchNew.isMatch = false;
|
|
|
|
|
return this.confirmMatchNew.redImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.confirmMatchNew.isMatch = true;
|
|
|
|
|
return this.confirmMatchNew.greenImg;
|
|
|
|
|
}
|
|
|
|
|
case 8:
|
|
|
|
|
if (!this.P_NEW_PASSWORD.includes(this.P_USER_NAME)) {
|
|
|
|
|
this.userNameMatchNew.isMatch = true;
|
|
|
|
|
return this.userNameMatchNew.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.userNameMatchNew.isMatch = false;
|
|
|
|
|
return this.userNameMatchNew.redImg;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!this.P_NEW_PASSWORD.includes(this.P_USER_NAME)) {
|
|
|
|
|
this.userNameMatchNew.isMatch = true;
|
|
|
|
|
return this.userNameMatchNew.greenImg;
|
|
|
|
|
} else {
|
|
|
|
|
this.userNameMatchNew.isMatch = false;
|
|
|
|
|
return this.userNameMatchNew.redImg;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|