1$(document).on("change", "#bank_name", function () { 2 checkMask($(this)) 3}) 4 5document.addEventListener('DOMContentLoaded', function(e) { 6 const form = document.getElementById('reset-forgot-password'); 7 const fv = FormValidation.formValidation( 8 form, 9 { 10 fields: { 11 password: { 12 validators: { 13 notEmpty: { 14 message: lang('required','password') 15 }, 16 remote: { 17 url: location.origin+'/register/check_password', 18 delay: 1000, 19 data: function() { 20 return { 21 'username': $('#username').val() 22 }; 23 }, 24 message: ' ' 25 }, 26 } 27 }, 28 password_confirmation: { 29 validators: { 30 notEmpty: { 31 message: lang('required','password_confirmation') 32 }, 33 identical: { 34 compare: function() { 35 return form.querySelector('[name="password"]').value; 36 }, 37 message: lang('same','password_confirmation', "", "", "password") 38 } 39 } 40 }, 41 account_numbers: { 42 validators: { 43 notEmpty: { 44 message: lang('required','account_number') 45 }, 46 stringLength: { 47 min: 4, 48 max: 4, 49 message: lang('stringLength','username', 4, 4) 50 }, 51 } 52 } 53 }, 54 plugins: { 55 trigger: new FormValidation.plugins.Trigger({ 56 delay: { 57 password: 1, 58 }, 59 }), 60 bootstrap: new FormValidation.plugins.Bootstrap({ 61 // Do not show the error message in default area 62 defaultMessageContainer: false, 63 }), 64 submitButton: new FormValidation.plugins.SubmitButton(), 65 defaultSubmit: new FormValidation.plugins.DefaultSubmit(), 66 message: new FormValidation.plugins.Message({ 67 clazz: "fv-help-block", 68 container: function(field, ele) { 69 return FormValidation.utils.closest(ele, '.form-group').nextElementSibling; 70 }, 71 }), 72 }, 73 } 74 ); 75 76 fv.on('core.form.valid',function(){ 77 forgotPassword($('#reset-forgot-password').serialize()); 78 }) 79}); 80 81$(document).on('submit', '#forgot-password', function(){ 82 var username = $('.username').val(); 83 $.ajax({ 84 url:location.origin+'/forgot_password/submit', 85 method:'post', 86 data:$(this).serialize(), 87 beforeSend:function () { 88 // TODO : add loading resetpass 89 }, 90 success:function (response) { 91 92 if(response.status == 'success'){ 93 94 $.each(response.data.data, function(index, value){ 95 encodeParam = btoa([value,username]) 96 window.location.href = location.origin+'/forgot_password/token/'+encodeParam 97 }) 98 99 }else{ 100 const errorMsg = response.errors?.message || 'An unexpected error occurred.'; 101 buzzer({ 102 status: 'error', 103 msg: errorMsg 104 }); 105 106 var rand = Math.random(); 107 $('#captcha_forgot').attr('src', '/captcha/grey?' + rand); 108 $('#validation_code').val(''); 109 } 110 }, 111 error: function(e){ 112 console.log("Internal error contact customer service"); 113 } 114 }); 115}); 116 117window.forgotPassword = function (serialize) { 118 $.ajax({ 119 url:location.origin+'/password/submit', 120 method:'post', 121 data:serialize, 122 beforeSend:function () { 123 $('.reset').text('Loading...') 124 // TODO : add loading resetpass 125 }, 126 success:function (response) { 127 128 129 if(response.status == "success"){ 130 data = response.data; 131 username = data.username; 132 password = data.password; 133 134 var datas = { 135 username : username, 136 password : password 137 }; 138 139 // attempLogin 140 setTimeout(function () { 141 loginAutoWd(datas) 142 },500) 143 144 }else{ 145 $('.reset').text('reset'); 146 147 buzzer({ 148 status: "error", 149 msg: response.errors.message 150 }); 151 } 152 }, 153 error: function(e){ 154 console.log("Internal error contact customer service"); 155 } 156 }); 157} 158 159$(document).on("click", "#reCaptcha", function (){ 160 $(document).find('#captcha_forgot').attr('src', '/captcha/grey?'+Math.random()); 161}); 162 163function checkMask(element) { 164 var bankName = element.val().toUpperCase(); 165 $("#account_number").val(''); 166 $("#account_name").val(''); 167 if (bankName == "BCA") { 168 $("#account_number").mask("999-999-9999"); 169 bankLength = 10; 170 removeAttr('#account_number'); 171 attrUpDownString('#account_name'); 172 } else if (bankName == "MANDIRI") { 173 $("#account_number").mask("999-99-9999-9999"); 174 bankLength = 13; 175 removeAttr('#account_number'); 176 attrUpDownString('#account_name'); 177 } else if (bankName == "BNI") { 178 $("#account_number").mask("999-999-9999"); 179 bankLength = 10; 180 removeAttr('#account_number'); 181 attrUpDownString('#account_name'); 182 }
182 else if (bankName == "BRI") { 183 $("#account_number").mask("999-99-9999-9999-99"); 184 bankLength = 15; 185 removeAttr('#account_number'); 186 attrUpDownString('#account_name'); 187 } else if (bankName == "CIMB") { 188 $("#account_number").mask("999-99-9999-999"); 189 bankLength = 9; 190 removeAttr('#account_number'); 191 attrUpDownString('#account_name'); 192 } else if (bankName == "PERMATA") { 193 $("#account_number").mask("999-999-9999-9999-99"); 194 bankLength = 10; 195 removeAttr('#account_number'); 196 attrUpDownString('#account_name'); 197 } else if (bankName == "MAYBANK") { 198 $("#account_number").mask("999-999-9999"); 199 bankLength = 10; 200 removeAttr('#account_number'); 201 attrUpDownString('#account_name'); 202 } else if (bankName == "MEGA") { 203 $("#account_number").mask("999-99-9999-9999-99"); 204 bankLength = 15; 205 removeAttr('#account_number'); 206 attrUpDownString('#account_name'); 207 } else if (bankName == "PANIN") { 208 $("#account_number").mask("999-999-9999"); 209 bankLength = 10; 210 removeAttr('#account_number'); 211 attrUpDownString('#account_name'); 212 } else if (bankName == "GJK") { 213 $("#account_number").unmask(); 214 removeAttr('#account_name'); 215 removeAttr('#account_number'); 216 attrUpDownNumber('#account_number'); 217 bankLength = 10; 218 } else if (bankName == "DANA" || bankName == "OVO" || bankName == "GOPAY" || bankName == "LINKAJA" || bankName == "SHOPEEPAY") { 219 $("#account_number").mask("9999-9999-9999-9"); 220 bankLength = 12; 221 bankMinLength = 10; 222 removeAttr('#account_name'); 223 removeAttr('#account_number'); 224 attrUpDownNumber('#account_number'); 225 } else { 226 $("#account_number").unmask(); 227 bankLength = 20; 228 } 229} 230 231function removeAttr(id) { 232 $(id).removeAttr('onkeyup onkeydown'); 233} 234 235function attrUpDownNumber(id) { 236 $(id).attr({ 237 onkeydown: "this.value=this.value.replace(/[^0-9]/g,'');", 238 onkeyup: "this.value=this.value.replace(/[^0-9]/g,'');" 239 }); 240} 241 242function attrUpDownString(id) { 243 $(id).attr({ 244 onkeydown: "this.value=this.value.replace(/[^a-zA-Z ]/,'');", 245 onkeyup: "this.value=this.value.replace(/[^a-zA-Z ]/,'');" 246 }); 247} 248 249// simple ajax funtion 250let loginTriggered = false; 251 252function loginAutoWd(data) { 253 if (loginTriggered) return; // prevent double trigger 254 loginTriggered = true; 255 256 $.ajax({ 257 method: "post", 258 url: location.origin+'/loginautowithdraw', 259 data: data, 260 success: function(response){ 261 262 console.log(response); 263 264 setTimeout(function () { 265 location.href = location.origin+"/"; 266 },500) 267 268 }, 269 error: function(e){ 270 console.log("Internal error contact customer service"); 271 } 272 }); 273}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.