1(function($) { 2 "use strict"; 3 4 /***************************** 5 MANAGE PASSWORD RECOVERY 6 ******************************/ 7 8 let pcma_psw_is_acting = false; // security var to avoid multiple calls 9 10 // show recovery form 11 $(document).on('click', '.pcma_psw_recovery_trigger', function() { 12 const $pcma_form = $(this).parents('form'); 13 14 $pcma_form.children().hide(); 15 $pcma_form.find('.pcma_psw_recovery_wrap').fadeIn(); 16 }); 17 18 19 // hide recovery form 20 $(document).on('click', '.pcma_del_recovery', function() { 21 const $pcma_form = $(this).parents('form'); 22 23 $pcma_form.children().fadeIn(); 24 $pcma_form.find('.pcma_psw_recovery_wrap').hide(); 25 }); 26 27 28 // handle recovery request 29 $(document).on('click', '.pcma_do_recovery', function(e) { 30 e.preventDefault(); 31 32 const $target_div = $(this).parents('form'); 33 let pcma_username = $target_div.find('.pcma_psw_username').val(); 34 35 if(pcma_psw_is_acting || !$.trim(pcma_username)) { 36 return false; 37 } 38 39 // anti bruteforce 40 if(pc_vars.abfa_blocked) { 41 $target_div.find('.pcma_psw_recovery_message').empty().append('<span class="pc_error_mess">'+ pc_vars.abfa_error_mess +'</span></div>'); 42 return false; 43 } 44 45 pcma_psw_is_acting = true; 46 47 $target_div.find('.pcma_do_recovery').addClass('pc_spinner_btn'); 48 $target_div.find('.pcma_del_recovery').fadeOut('fast'); 49 50 var cur_url = $(location).attr('href'); 51 52 $.ajax({
53 type: "POST", 54 url: cur_url, 55 dataType: "json", 56 data: "pcma_psw_recovery=1&pcma_username=" + pcma_username, 57 success: function(pcma_data) { 58 if(pcma_data.resp == 'success') { 59 $target_div.find('.pcma_psw_recovery_message').empty().append('<span class="pc_success_mess">' + pcma_data.mess + '</span>'); 60 61 $('.pcma_do_recovery').fadeOut(function() { 62 $(this).remove(); 63 }); 64 } 65 else { 66 $target_div.find('.pcma_psw_recovery_message').empty().append('<span class="pc_error_mess">' + pcma_data.mess + '</span>'); 67 68 // anti bruteforce 69 if(pcma_data.abfa) { 70 pc_vars.abfa_blocked = true; 71 } 72 } 73 } 74 }) 75 .fail(function(e) { 76 if(e.status) { 77 console.error(e); 78 79 $target_div.find('.pcma_psw_recovery_message').empty().append('<span class="pc_error_mess">'+ pc_vars.ajax_failed_mess +'</span>'); 80 } 81 }) 82 .always(function() { 83 pcma_psw_is_acting = false; 84 85 // a bit of delay to display the loader 86 setTimeout(function() { 87 $target_div.find('.pcma_do_recovery').removeClass('pc_spinner_btn'); 88 }, 370); 89 90 $target_div.find('.pcma_del_recovery').fadeIn('fast'); 91 }); 92 }); 93 94})(jQuery);
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.