var badUserName='|LANG_INVALID_USERNAME|'; var shortUserName='|LANG_SHORT_USERNAME|'; var longUserName='|LANG_USERNAME_NO_MORE| |MAX_USERNAME_LENGTH| |LANG_CHARACTERS|'; var noPassMatch='|LANG_PASS_NO_MATCH|'; var shortPass='|LANG_SHORT_PASS|'; var shortDomain='|LANG_SHORT_DOMAIN|'; var domainNeedsDot='|LANG_DOMAIN_DOT|'; var invalidDomain='|LANG_INVALID_DOMAIN|'; var badIP='|LANG_INVALID_IP|'; var badEmail='|LANG_INVALID_EMAIL|'; function show_alert(str, field, message) { |*if AJAX="1"| if (document.getElementById(field)) { document.getElementById(field).style.backgroundColor="|BAD_COLOR|"; } if (document.getElementById(message)) { document.getElementById(message).innerHTML=str; } else { alert(str); } |*else| alert(str); |*endif| } function set_ok(field, message) { |*if AJAX="1"| if (document.getElementById(field)) { document.getElementById(field).style.backgroundColor="|GOOD_COLOR|"; } if (document.getElementById(message)) { document.getElementById(message).innerHTML=''; } |*endif| } function nameOK(name) { var ch; var i; if (name.length < 2) return false; if (name.length > |MAX_USERNAME_LENGTH|) return false; for (i=0; i= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9')) || ch==' ' ) return false; else if (!((ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || (ch=='_') || (ch=='-')) || ch==' ') return false; } return true; } function checkName() { with (document.reseller) { if (username.value.length < 2) { username.focus(); username.select(); alert(shortUserName); return false; } else if (username.value.length > |MAX_USERNAME_LENGTH|) { username.focus(); username.select(); alert(longUserName); return false; } else if (nameOK(username.value)) return true; else { username.focus(); username.select(); alert(badUserName); return false; } } return false; } function passOK() { with (document.reseller) { if (passwd.value.length < 5) { //alert(shortPass); show_alert(shortPass, 'passwd', 'passwd_result'); passwd2.value=""; passwd.focus(); passwd.select(); return 0; } if (passwd.value != passwd2.value) { //alert(noPassMatch); show_alert(noPassMatch, 'passwd2', 'passwd_result'); passwd2.focus(); passwd2.select(); return 0; } } return 1; } function checkPass() { with (document.reseller) { if (passOK()) { set_ok('passwd2', 'passwd_result') return true; } } } function ipOK(ip) { var ch; var i; var dotCount = 0; if (ip.length < 7) return 0; if (ip.charAt(0) == '.' || ip.charAt(ip.length-1) == '.') return 0; for (i=0; i= 0 && ch <= 9) ) return 0; } if (dotCount < 3) return 0; return 1; } function checkDomainIP() { with (document.reseller) { if (sharedip.checked) return 1; if (!ipOK(ip.value)) { alert(badIP) ip.focus(); ip.select(); return 0; } } return 1; } function domainOK(domain) { var ch; var i; var dotCount = 0; if (domain.length < 3) { alert(shortDomain); return 0; } if (domain.charAt(domain.length-1) == '.') { alert(invalidDomain); return 0; } for (i=0; i= 20) { alert("Unable to generate a password with a number, upper and lower case characters in it. Tried 20 times"); return "error1"; } var length_min = |RANDOM_PASSWORD_LENGTH|; var length_max = |RANDOM_PASSWORD_LENGTH_MAX|; var length = Math.floor(Math.random() * (1 + length_max - length_min)) + length_min; |*if SPECIAL_CHARACTERS_IN_RANDOM_PASSWORDS="1"| var chars = ''; for (i=33; i<=126; i++) { if (i == 47) continue; if (i == 92) continue; chars = chars + String.fromCharCode(i); } |*else| var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; |*endif| var pass = ""; var i=0; for (i=0; i