The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Can anyone see why this script might not work?
My PHP skills aren't so hot, and this script that USED TO work, but has not ever been changed, no longer works now.
This is for Live Feedback Registration and vB 3.8.3. It's the email verification function. It always ends up failing to connect to legitimate email address'. If anyone could just look over the code real quick and see if anything stands out I'd really appreciate it. I'd like to get this working. Everything else but the email check works just fine. email_check.php PHP Code:
Code:
//Live Feedback Registration 1.31 var currentSelect = ''; function _loadTextDoc(url, query_string, callback) { entry_check = new vB_AJAX_Handler(true); entry_check.onreadystatechange(callback); entry_check.send(url, query_string); } function _processNameInput() { if(entry_check.handler.readyState == 4) { if(entry_check.handler.status == 200) { liveCheck('', entry_check.handler.responseText); } } } function liveCheck(input, response, min_user_length) { var namecheck = fetch_object('nameCheck'); if(response != ''){ switch (response){ case '3':_replaceText(namecheck, lfsr_username_invalid_semicolon, 'namebad');break; case '2':_replaceText(namecheck, lfsr_username_invalid_censored, 'namebad');break; case '1':_replaceText(namecheck, lfsr_username_not_available, 'namebad');break; case '0':_replaceText(namecheck, lfsr_username_available, 'namegood');break; } } else { if(input.length >= parseInt(min_user_length, '10')){ _loadTextDoc('username_check.php', 'username='+PHP.urlencode(input), _processNameInput); } else { if(input.length >= 1){ _replaceText(namecheck, lfsr_username_too_short, 'nametooshort'); } else { _replaceText(namecheck, lfsr_username_choose, 'namechoose'); } } } } function match_fields(id,type){ fieldcheck = fetch_object(id); if(type == 'password'){ field1 = document.forms.register.password; field2 = document.forms.register.passwordconfirm; matchAllow = false; //temp }else{ field1 = document.forms.register.email; field2 = document.forms.register.emailconfirm; } if(!matchAllow){ switch (true){ case field1.value == '' || field2.value == '': _replaceText(fieldcheck, lfsr_match_fill_both, 'nametooshort'); break; case field1.value != field2.value: _replaceText(fieldcheck, lfsr_match_false, 'namebad'); break; default:_replaceText(fieldcheck, lfsr_match_true, 'namegood');break; } } } function _processRefererInput() { if(entry_check.handler.readyState == 4) { if(entry_check.handler.status == 200) { checkReferer('', entry_check.handler.responseText); } } } function checkReferer(input, response, min_user_length){ referer_check = fetch_object('lfsreferer'); var field1 = document.forms.register.referrername; if(response != ''){ switch (response){ case '1':_replaceText(referer_check, lfsr_username_member_true, 'namegood');break; default:_replaceText(referer_check, lfsr_username_member_false, 'namebad');;break; } } else { switch (true){ case input.length >= parseInt(min_user_length, '10'): _loadTextDoc('username_check.php', 'username='+PHP.urlencode(input), _processRefererInput); break; case input.length >= 1: _replaceText(referer_check, lfsr_username_member_false, 'namebad'); break; } } } function _processEmailInput(){ if(entry_check.handler.readyState == 4) { if(entry_check.handler.status == 200) { checkEmail('', entry_check.handler.responseText); } } } function checkEmail(input, response){ email_check = fetch_object('lfseconfirm'); matchAllow = true; switch(true){ case response == '': if(currentSelect != input){ if(email_check.firstChild != lfsr_email_validation_progress && input != ''){ _replaceText(email_check, lfsr_email_validation_progress, 'emailtooshort'); } switch (true){ case /^[A-z0-9\.!#\$%&\'\*\+-\/=\?\{|}~]+@([0-9.]+|([^\s]+\.+[A-z]{2,6}))$/.test(input): _loadTextDoc('email_check.php', 'email='+PHP.urlencode(input), _processEmailInput); currentSelect = input; break; case input.length >= 1: _replaceText(email_check, lfsr_email_invalid, 'emailbad'); break; } } break; case response != '': switch (response){ case '5':_replaceText(email_check, lfsr_email_reject+' '+lfsr_email_submit_valid, 'emailbad');break; case '4':_replaceText(email_check, lfsr_email_no_responce, 'emailbad');break; case '3':_replaceText(email_check, lfsr_email_no_connect+' '+lfsr_email_submit_valid, 'emailbad');;break; case '2':_replaceText(email_check, lfsr_email_banned, 'emailbad');break; case '1':_replaceText(email_check, lfsr_email_exists, 'emailbad');break; case '0':_replaceText(email_check, lfsr_email_valid, 'emailgood');matchAllow = false;break; } break; } } function pwSuggest(){ var email_check_on = fetch_object('lfseconfirm'); if (email_check_on.className == 'warning'){ _replaceText(email_check_on, '', ''); } suggest = fetch_object('pw_suggest'); suggestText = fetch_object('pw_suggest_text'); var pwsize=Math.floor(Math.random()*8)+7; chars = '+-*abcdefghijklmn!op$qrst~uvwxyz@;ABCDEFGHIJ^KLMNOP_QRSTUV#&WXYZ1234.567890%'; pass = ''; for(x=0;x<pwsize;x++){ pass += chars.charAt(Math.floor(Math.random() * 72)); } _replaceText(suggestText, lfsr_password_suggest, 'pwsuggest'); _replaceText(suggest, pass, 'pwsuggest'); } function livePassCheck(pw, pwsug){ var pwlength = pw.length; if (pwlength == 1){ //_replaceText(fetch_object('pw_strength_title'), 'Password Strength:', ''); _replaceText(fetch_object('pw_guideline'), lfsr_password_guid, 'pwwarning'); suggest = fetch_object('pw_suggest'); } if (pwlength == 0){ if(pwsug != 0){ pwSuggest(); } //_replaceText(fetch_object('pw_strength_title'), 'Password Strength:', ''); _replaceText(fetch_object('pw_guideline'), '', ''); } if(pwlength > 0){ var boost = 0; if(pwlength > 9){pwlength = 9;} var numnum = pw.replace (/[\d]/g,''); var num = (pw.length - numnum.length); if(num > 3){num = 3;} if(num == 2){num = 3;}else if(num == 3){num = 4;} var symbols = pw.replace (/\W/g,''); var symb = (pw.length - symbols.length); if(symb > 3){symb = 3;} if(symb == 2){symb = 4;}else if(symb == 3){symb = 6;} var numup = pw.replace (/[A-Z]/g,''); var up = (pw.length - numup.length); if(up > 3){up = 3;} if(up == 2){up = 3; } else if(up == 3){up = 4;} var numlow = pw.replace (/[A-Z]/g,''); var low = (pw.length - numlow.length); if(low > 3){low = 3;} if(low == 2){low = 3; } else if(low == 3){low = 4;} if(num >= 1 && symb >= 1 && up >= 1 && low >= 1){boost+=2;} if(num >= 3 && symb >= 4 && up >= 3 && low >= 3){boost+=4;} if(num >= 4 && symb >= 6 && up >= 4 && low >= 4){boost+=6;} var pwstr = pwlength + num + symb + up + low + boost; if(pwstr < 0){pwstr = 0;} if(pwstr > 100){pwstr = 100;} switch(true){ case pwstr < 10:_replaceText(fetch_object('lfspwconfirm'), lfsr_password_strength_very_weak, 'pw_veryweak');break; case pwstr < 15:_replaceText(fetch_object('lfspwconfirm'), lfsr_password_strength_weak, 'pw_weak');break; case pwstr < 20:_replaceText(fetch_object('lfspwconfirm'), lfsr_password_strength_mediocre, 'pw_mediocre');break; case pwstr < 27:_replaceText(fetch_object('lfspwconfirm'), lfsr_password_strength_strong, 'pw_strong');break; case pwstr > 26:_replaceText(fetch_object('lfspwconfirm'), lfsr_password_strength_verystrong, 'pw_verystrong');break; } }else{ _replaceText(fetch_object('lfspwconfirm'), '', ''); } } function _replaceText(el, text, class_name, colspan, width) { if(el.firstChild){ el.removeChild(el.firstChild); if(el.firstChild){ el.removeChild(el.firstChild); } } el.appendChild(document.createTextNode(text)); el.className = class_name; } function loadDefault(){_replaceText(fetch_object('lfseconfirm'), lfsr_email_default, 'warning');} |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|