<% '========================================================= ' File: reg.asp ' Version:5.0 ' Date: 2002-12-3 ' Script Written by satan '========================================================= ' Copyright (C) 2001,2002 AspSky.Net. All rights reserved. ' Web: http://www.aspsky.net,http://www.dvbbs.net ' Email: info@aspsky.net,eway@aspsky.net '========================================================= response.buffer=true Dim SendMail call nav() if Cint(forum_setting(37))=0 then stats="论坛错误信息" Errmsg="
  • 本论坛暂时停止注册。" call head_var(2,0,"","") call dvbbs_error() else if request("action")="apply" then stats="填写资料" call head_var(0,0,"论坛注册","reg.asp") call reg_2() elseif request("action")="save" then stats="提交注册" call head_var(0,0,"论坛注册","reg.asp") call reg_3() if founderr then call dvbbs_error() else stats="注册协议" call head_var(0,0,"论坛注册","reg.asp") call reg_1() end if end if call activeonline() call footer() sub reg_1() %>
    服务条款和声明
    <% end sub sub reg_2() %>
    <%if cint(Forum_Setting(23))<>1 then%> <%end if%>
    新用户注册
    用户名
    注册用户名长度限制为<%=forum_setting(40)%>-<%=forum_setting(41)%>字节
    性别
    请选择您的性别
    男孩      女孩
    密码(至少6位)
    请输入密码,区分大小写。
    请不要使用任何类似 '*'、' ' 或 HTML 字符
    密码(至少6位)
    请再输一遍确认
    密码问题
    忘记密码的提示问题
    问题答案
    忘记密码的提示问题答案,用于取回论坛密码
    Email地址
    请输入有效的邮件地址,这将使您能用到论坛中的所有功能
    
    <%if Cint(forum_setting(54))=0 then%> <%end if%> <%if cint(Forum_Setting(32))=1 then%> <%end if%> <%if Cint(forum_setting(42))=1 then%> <%end if%> align=center>
    显示高级用户设置选项 
    <% end sub sub reg_3() dim username,sex,pass1,pass2,password dim useremail,face,width,height dim oicq,sign,showRe,birthday dim mailbody,sendmsg,rndnum,num1 dim quesion,answer,topic dim userinfo,usersetting dim userclass if not isnull(session("regtime")) or cint(Forum_Setting(22))>0 then if DateDiff("s",session("regtime"),Now())"+"
  • 本论坛限制每次注册距离时间为"&Forum_Setting(22)&"秒,请稍后注册。" FoundErr=True end if end if if chkpost=false then ErrMsg=ErrMsg+"
    "+"
  • 您提交的数据不合法,请不要从外部提交发言。" FoundErr=True end if if request("name")="" or strLength(request("name"))>Cint(forum_setting(41)) or strLength(request("name"))"+"
  • 请输入您的用户名(长度不能大于"&forum_setting(41)&"小于"&forum_setting(40)&")。" founderr=true else username=trim(request("name")) end if if Instr(request("name"),"=")>0 or Instr(request("name"),"%")>0 or Instr(request("name"),chr(32))>0 or Instr(request("name"),"?")>0 or Instr(request("name"),"&")>0 or Instr(request("name"),";")>0 or Instr(request("name"),",")>0 or Instr(request("name"),"'")>0 or Instr(request("name"),",")>0 or Instr(request("name"),chr(34))>0 or Instr(request("name"),chr(9))>0 or Instr(request("name"),"")>0 or Instr(request("name"),"$")>0 then errmsg=errmsg+"
    "+"
  • 用户名中含有非法字符。" founderr=true else username=trim(request("name")) end if splitwords=split(splitwords,",") for i = 0 to ubound(splitwords) if instr(username,splitwords(i))>0 then errmsg=errmsg+"
    "+"
  • 您输入的用户名包含系统禁止注册字符。" founderr=true exit for end if next if request("sex")=0 or request("sex")=1 then sex=request("sex") else sex=1 end if if request("showRe")=0 or request("showRe")=1 then showRe=request("showRe") else showRe=1 end if if cint(Forum_Setting(23))=1 then Randomize Do While Len(rndnum)<8 num1=CStr(Chr((57-48)*rnd+48)) rndnum=rndnum&num1 loop password=md5(rndnum) else if request("psw")="" or len(request("psw"))>10 or len(request("psw"))<6 then errmsg=errmsg+"
    "+"
  • 请输入您的密码(长度不能大于10小于6)。" founderr=true else pass1=request("psw") end if if request("pswc")="" or strLength(request("pswc"))>10 or len(request("pswc"))<6 then errmsg=errmsg+"
    "+"
  • 请输入确认密码(长度不能大于10小于6)。" founderr=true else pass2=request("pswc") end if if pass1<>pass2 then errmsg=errmsg+"
    "+"
  • 您输入的密码和确认密码不一致。" founderr=true else password=md5(pass2) end if end if if request("quesion")="" then errmsg=errmsg+"
    "+"
  • 请输入密码提示问题。" founderr=true else quesion=request("quesion") end if if request("answer")="" then errmsg=errmsg+"
    "+"
  • 请输入密码提示问题答案。" founderr=true elseif request("answer")=request("oldanswer") then answer=request("answer") else answer=md5(request("answer")) end if if IsValidEmail(trim(request("e_mail")))=false then errmsg=errmsg+"
    "+"
  • 您的Email有错误。" founderr=true else if not isnull(forum_setting(52)) and forum_setting(52)<>"" and forum_setting(52)<>"0" then Dim SplitUserEmail SplitUserEmail=split(forum_setting(52),"|") For i=0 to ubound(SplitUserEmail) if instr(request("e_mail"),SplitUserEmail(i))>0 then errmsg=errmsg+"
    "+"
  • 您填写的Email地址含有系统禁止字符。" founderr=true exit for end if Next end if useremail=checkStr((request("e_mail"))) end if if request.form("myface")<>"" and Cint(forum_setting(54))=0 then if request("width")="" or request("height")="" then errmsg=errmsg+"
    "+"
  • 请输入图片的宽度和高度。" founderr=true elseif not isInteger(request("width")) or not isInteger(request("height")) then errmsg=errmsg+"
    "+"
  • 您输入的字符不合法。" founderr=true elseif Cint(request("width"))>Cint(forum_setting(57)) then errmsg=errmsg+"
    "+"
  • 您输入的图片宽度不符合标准。" founderr=true elseif Cint(request("height"))>Cint(forum_setting(57)) then errmsg=errmsg+"
    "+"
  • 您输入的图片高度不符合标准。" founderr=true else if Cint(forum_setting(55))=0 then if instr(lcase(request("myface")),"http://")>0 or instr(lcase(request("myface")),"www.")>0 then errmsg=errmsg+"
    "+"
  • 本论坛设置了不允许连接外部网址做头像。" founderr=true end if end if face=request("myface") end if else if request("face")<>"" then face=request("face") end if end if width=request("width") height=request("height") if request("oicq")<>"" then if not isnumeric(request("oicq")) or len(request("oicq"))>10 then errmsg=errmsg+"
    "+"
  • Oicq号码只能是4-10位数字,您可以选择不输入。" founderr=true end if end if if request.Form("birthyear")="" or request.form("birthmonth")="" or request.form("birthday")="" then birthday="" else birthday=trim(Request.Form("birthyear"))&"-"&trim(Request.Form("birthmonth"))&"-"&trim(Request.Form("birthday")) if not isdate(birthday) then birthday="" end if userinfo=checkreal(request.Form("realname")) & "|||" & checkreal(request.Form("character")) & "|||" & checkreal(request.Form("personal")) & "|||" & checkreal(request.Form("country")) & "|||" & checkreal(request.Form("province")) & "|||" & checkreal(request.Form("city")) & "|||" & request.Form("shengxiao") & "|||" & request.Form("blood") & "|||" & request.Form("belief") & "|||" & request.Form("occupation") & "|||" & request.Form("marital") & "|||" & request.Form("education") & "|||" & checkreal(request.Form("college")) & "|||" & checkreal(request.Form("userphone")) & "|||" & checkreal(request.Form("address")) usersetting=request.Form("setuserinfo") & "|||" & request.Form("setusertrue") if founderr then exit sub dim titlepic set rs=conn.execute("select usertitle,titlepic from usertitle where not minarticle=-1 order by minarticle") userclass=rs(0) titlepic=rs(1) set rs=server.createobject("adodb.recordset") if cint(Forum_Setting(24))=1 then sql="select * from [user] where username='"&username&"' or useremail='"&useremail&"'" else sql="select * from [user] where username='"&username&"'" end if rs.open sql,conn,1,3 if not rs.eof and not rs.bof then if cint(Forum_Setting(24))=1 then errmsg=errmsg+"
    "+"
  • 您输入的用户名已经被注册或者已经有用户使用了您填写的电子邮件地址。" founderr=true exit sub else errmsg=errmsg+"
    "+"
  • 您输入的用户名已经被注册。" founderr=true exit sub end if else rs.addnew rs("username")=username rs("userpassword")=password rs("useremail")=useremail rs("userclass")=userclass rs("titlepic")=titlepic rs("quesion")=quesion rs("answer")=answer if request("Signature")<>"" then rs("sign")=trim(request("Signature")) end if if request("oicq")<>"" then rs("oicq")=request("oicq") end if if request("icq")<>"" then rs("icq")=request("icq") end if if request("msn")<>"" then rs("msn")=request("msn") end if Rs("article")=0 if cint(Forum_Setting(25))=1 then rs("usergroupid")=5 else Rs("usergroupid")=4 end if rs("lockuser")=0 Rs("sex")=sex Rs("showRe")=showRe if birthday<>"" then rs("birthday")=birthday end if rs("UserGroup")=request("GroupName") Rs("addDate")=NOW() if request.form("myface")<>"" then rs("face")=replace(face,"'","") else rs("face")=replace(face,"'","") end if Rs("width")=width Rs("height")=height rs("logins")=1 Rs("lastlogin")=NOW() rs("userWealth")=Forum_user(0) rs("userEP")=Forum_user(5) rs("usercP")=Forum_user(10) rs("userinfo")=userinfo rs("usersetting")=usersetting rs("bbstype")=tempid rs.update conn.execute("update config set usernum=usernum+1,lastuser='"&username&"'") end if rs.close set rs=nothing set rs=conn.execute("select top 1 userid,face from [user] order by userid desc") userid=rs(0) '****************** '对上传头象进行过滤与改名 if Cint(Forum_Setting(7))=1 then on error resume next dim objFSO,facename dim upface,newfilename facename=rs(1) if instr(facename,"uploadFace/") then facename=split(facename,"/") upface="uploadFace/"&facename(ubound(facename)) newfilename="uploadFace/"&userid&"_"&facename(ubound(facename)) Set objFSO = Server.CreateObject("Scripting.FileSystemObject") if objFSO.fileExists(Server.MapPath(upface)) then objFSO.movefile ""&Server.MapPath(upface)&"",""&Server.MapPath(newfilename)&"" if Err.Number = 0 then conn.execute("update [user] set face='"&replace(newfilename,"'","")&"' where userid="&userid) end if end if set objFSO=nothing end if end if '对上传头象进行过滤与改名结束 '**************** rs.close set rs=nothing if Forum_Setting(47)=1 then on error resume next '发送注册邮件 dim getpass topic="您在" & Forum_info(0) & "的注册资料" if cint(Forum_Setting(23))=1 then getpass=htmlencode(rndnum) else getpass=htmlencode(request("psw")) end if %> <% select case Cint(Forum_Setting(2)) case 0 sendmsg="
  • 系统未开启邮件功能,请记住您的注册信息。
  • " case 1 call jmail(useremail,topic,mailbody) case 2 call Cdonts(useremail,topic,mailbody) case 3 call aspemail(useremail,topic,mailbody) case else sendmsg="
  • 系统未开启邮件功能,请记住您的注册信息。
  • " end select if SendMail="OK" then if cint(Forum_Setting(23))=1 then sendmsg="
  • 您的注册信息和密码已经发往您的邮箱,请使用系统给您的密码登陆。
  • " else sendmsg="
  • 您的注册信息已经发往您的邮箱,请注意查收。
  • " end if else sendmsg="
  • 由于系统错误,给您发送的注册资料未成功。
  • " end if 'response.write mailbody end if if Forum_Setting(46)=1 then '发送注册短信 dim sender,title,body sender=Forum_info(0) title=Forum_info(0)&"欢迎您的到来" %> <% 'response.write body sql="insert into message(incept,sender,title,content,sendtime,flag,issend) values('"&username&"','"&sender&"','"&title&"','"&body&"',Now(),0,1)" conn.Execute(sql) end if if cint(Forum_Setting(23))=1 or cint(Forum_Setting(25))=1 then else if founduser then Response.Cookies("aspsky").path=cookiepath Response.Cookies("aspsky")("username")="" Response.Cookies("aspsky")("password")="" Response.Cookies("aspsky")("userclass")="" Response.Cookies("aspsky")("userid")="" Response.Cookies("aspsky")("userhidden")="" Response.Cookies("aspsky")("usercookies")="" conn.execute("delete from online where username='"&membername&"'") end if select case request("usercookies") case 0 Response.Cookies("aspsky")("usercookies") = request("usercookies") case 1 Response.Cookies("aspsky").Expires=Date+1 Response.Cookies("aspsky")("usercookies") = request("usercookies") case 2 Response.Cookies("aspsky").Expires=Date+31 Response.Cookies("aspsky")("usercookies") = request("usercookies") case 3 Response.Cookies("aspsky").Expires=Date+365 Response.Cookies("aspsky")("usercookies") = request("usercookies") end select Response.Cookies("aspsky")("username") = username Response.Cookies("aspsky")("password") = password Response.Cookies("aspsky")("userclass") = userclass Response.Cookies("aspsky")("userid") = userid Response.Cookies("aspsky")("userhidden") = 2 Response.Cookies("aspsky").path=cookiepath end if session("regtime")=now() %>
    注册成功:<%=Forum_info(0)%>欢迎您的到来

    <% end sub function checkreal(v) dim w if not isnull(v) then w=replace(v,"|||","§§§") checkreal=w end if end function %>