yajax.findRules['login']={ chars:/[\w. ]/, regexp:/^[\w. ]*$/, type:'S', len:30} yajax.findRules['name']={ regexp:/^./, type:'S', len:50} yajax.findRules['email']={ regexp:/^(("(\.|[^"])+")|[\d\w!$&*-=^`|~#%\047\057+?_{}]+)@([\w\d-]+\.)+[\w\d-]{2,}$/, type:'S', len:50} yajax.findRules['password']={ regexp:/^......../, type:'S'} yajax.findRules['passwordorblank']={ regexp:/^(........+)?$/, type:'S'} yajax.findRules['password2']={ regexp:/^......../, type:'S'} yajax.findRules['modpassword']={ regexp:/^(........+)?$/, type:'S'} yajax.findRules['modpassword2']={ regexp:/^(........+)?$/, type:'S'} yajax.findRules['login_button']={ server:1, passServer:[false,["login","password"]],before:function(yajax,request) {request["login"]=yajax.getValue("login"); request["password"]=yajax.getValue("password"); },after:function(yajax,request,serverOut) {login_redirect(serverOut["ref"]); }} yajax.findRules['logout']={ server:1} yajax.findRules['submit_mod']={ server:1, passServer:[false,["login","password","name","email"]],test:function(yajax,request) {if(yajax.isAJAX) yajax.checkForm("acct_form"); yajax.jsTest(yajax.getValue("modpassword2")==yajax.getValue("modpassword"), "match"); },before:function(yajax,request) {request["login"]=yajax.getValue("login"); request["password"]=yajax.getValue("modpassword"); request["name"]=yajax.getValue("name"); request["email"]=yajax.getValue("email"); }} yajax.findRules['submit_new']={ server:1, passServer:[false,["login","password","name","email"]],test:function(yajax,request) {if(yajax.isAJAX) yajax.checkForm("acct_form"); yajax.jsTest(yajax.getValue("modpassword2")==yajax.getValue("modpassword"), "match"); },before:function(yajax,request) {request["login"]=yajax.getValue("login"); request["password"]=yajax.getValue("password"); request["name"]=yajax.getValue("name"); request["email"]=yajax.getValue("email"); }} yajax.shareCode['complaint']=("if(id==\"password\"||id==\"modpassword\""+ "||id==\"password2\"||id==\"modpassword2\") {"+ "msg=\"passwords must have at least 8 characters\";"+ "}"+ "else if(id==\"login\") {"+ "if(prob==\"regexp\") msg=\"invalid character in username\";"+ "else msg=\"username is too long\";"+ "}"+ "else if(id==\"email\"||spec==\"email\") {"+ "if(prob==\"len\") msg=\"email address is too long\";"+ "else msg=\"not a valid email address\";"+ "}"+ "else if(spec==\"match\") {"+ "msg=\"password does not match password confirmation\";"+ "}"+ "else if(spec==\"dup\") {"+ "msg=\"That username is already in use+ Please try another\";"+ "}"+ "")