ZUM008.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. function fCommonCheckPassword(newpasswd, msgflag, userid){
  2. if(userid == null){
  3. userid = getUserId();
  4. }
  5. var alpha = /[a-zA-Z]/;
  6. var number = /[0-9]/;
  7. var special = /[\-_=+\|()*&^%$#@!~`?\]}\[{\;:/.>,< ]/;
  8. var repeat = /(\w)\1\1\1/;
  9. var strlength = /.{10,17}/;
  10. var flag1,flag2,flag3
  11. var lengthflag = false;
  12. var repeatflag = false;
  13. if(newpasswd.match(alpha) != null){
  14. flag1=true;
  15. }
  16. if(newpasswd.match(number) != null){
  17. flag2=true;
  18. }
  19. if(newpasswd.match(special) != null){
  20. flag3=true;
  21. }
  22. if(newpasswd.match(strlength) != null){
  23. lengthflag=true;
  24. }
  25. if(newpasswd.match(repeat) != null){
  26. repeatflag=true;
  27. }
  28. if(!(flag1 && flag2 && flag3) || !lengthflag){
  29. if(msgflag == null || msgflag == true)
  30. messageBox("10~17자 영문, 숫자, 특수문자를 모두 사용하십시오.","E999");
  31. return false;
  32. }
  33. if(repeatflag==true){
  34. if(msgflag == null || msgflag == true)
  35. messageBox("패스워드에 같은 문자/숫자를 4번 이상 사용하실 수 없습니다.","E999");
  36. return false;
  37. }
  38. if(newpasswd.toUpperCase().indexOf(userid.toUpperCase()) > -1){
  39. if(msgflag == null || msgflag == true)
  40. messageBox("ID 또는 사번과 동일한 문자는 사용하실 수 없습니다.","E999");
  41. return false;
  42. }
  43. return true;
  44. }
  45. //function fCommonCheckPassword(newpasswd, msgflag, userid){
  46. // if(userid == null){
  47. // userid = getUserId();
  48. // }
  49. //
  50. // //영문, 숫자 혼용해서 10~17자 이내
  51. // //var reg_pw = new RegExp(/^(?=.*[a-zA-Z])(?=.*[-_=+\|()\*&^%$#@!~`?\]}\[{\;:/.>,< ])(?=.*[0-9]).{10,17}$/g);
  52. // //var reg_pw = new RegExp("//^(?=.*[a-zA-Z])(?=.*[-_=+\|()\*&^%$#@!~`?\]}\[{\;:/.>,< ])(?=.*[0-9]).{10,17}$", "gi");
  53. // //var reg_pw = /^(?=.*[a-zA-Z])(?=.*[-_=+\|()\*&^%$#@!~`?\]}\[{\;:/.>,< ])(?=.*[0-9]).{10,17}$/gi;
  54. // var reg_pw = /^(?=.*[a-zA-Z])(?=.*[-_=+\|()\*&^%$#@!~`?\]}\[{\;:/.>,< ])(?=.*[0-9]).{10,17}$/;
  55. //
  56. // if(!reg_pw.test(newpasswd)) {
  57. // alert("1, " + msgflag);
  58. // if(msgflag == null || msgflag == true)
  59. // messageBox("10~17자 영문, 숫자, 특수문자를 모두 사용하십시오.","E999");
  60. // return false;
  61. // } else if(/(\w)\1\1\1/.test(newpasswd)) {
  62. // alert("2, " + msgflag);
  63. // if(msgflag == null || msgflag == true)
  64. // messageBox("패스워드에 같은 문자/숫자를 4번 이상 사용하실 수 없습니다.","E999");
  65. // return false;
  66. // } else if(newpasswd.toUpperCase().indexOf(userid.toUpperCase()) > -1){
  67. // alert("3, " + msgflag);
  68. // if(msgflag == null || msgflag == true)
  69. // messageBox("ID 또는 사번과 동일한 문자는 사용하실 수 없습니다.","E999");
  70. // return false;
  71. // }
  72. // alert("4, " + msgflag);
  73. // return true;
  74. //
  75. //}