1function pg_check_password_strenth() 2{ 3 var strength = checkStrength(jQuery('#pm_new_pass').val()); 4 jQuery('#pg_password_strenth_text').html(strength); 5 if(strength=='Medium' || strength=='Strong') 6 { 7 jQuery('#pm_member_reset_password_link').attr('onclick','pm_reset_user_password()'); 8 } 9} 10 11function checkStrength(password) 12{ 13 jQuery('#pg_password_meter_outer').show(); 14 var strength = 0 15// if (password.length < 6) { 16// jQuery('#pg_password_meter_inner').removeClass() 17// jQuery('#pg_password_meter_inner').addClass('pg-pass-short') 18// return 'Too short' 19// } 20 if (password.length > 7) strength += 1 21 // If password contains both lower and uppercase characters, increase strength value. 22 if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) strength += 1 23 // If it has numbers and characters, increase strength value. 24 if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) strength += 1 25 // If it has one special character, increase strength value. 26 if (password.match(/([!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1 27 // If it has two special characters, increase strength value. 28 if (password.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1 29 // Calculated strength value, we can return messages 30 // If value is less than 2 31 if (strength < 2) 32 { 33 jQuery('#pg_password_meter_inner').removeClass() 34 jQuery('#pg_password_meter_inner').addClass('pg-pass-weak') 35 jQuery('#pm_member_reset_password_link').removeClass(); 36 jQuery('#pm_member_reset_password_link').addClass('pg-setting-disabled'); 37 return 'Weak'; 38 } 39 else if (strength == 2) 40 { 41 jQuery('#pg_password_meter_inner').removeClass() 42 jQuery('#pg_password_meter_inner').addClass('pg-pass-good') 43 jQuery('#pm_member_reset_password_link').removeClass(); 44 return 'Medium'; 45 } 46 else 47 { 48 jQuery('#pg_password_meter_inner').removeClass() 49 jQuery('#pg_password_meter_inner').addClass('pg-pass-strong') 50 jQuery('#pm_member_reset_password_link').removeClass(); 51 return 'Strong'; 52 } 53}
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.