%
HtmlTop
UserEmail=HTMLEncode(Request("UserEmail"))
ActivationKey=HTMLEncode(Request("ActivationKey"))
ReferrerName=HTMLEncode(Request("ReferrerName"))
if SiteConfig("AllowNewUserRegistration")= 0 then error("本论坛暂时不允许新用户注册!")
if SiteConfig("AccountActivation")=2 then
if ActivationKey=empty then error("本论坛需要邀请码才能注册!")
if Conn.Execute("select UserName from [BBSXP_UserActivation] where ActivationKey='"&ActivationKey&"' and Email='"&UserEmail&"'").eof then error("邀请码错误!")
end if
if Request.Form("menu")="AddUserName" then
UserName=HTMLEncode(Request.Form("UserName"))
password=Trim(Request.Form("password"))
RetypePassword=Trim(Request.Form("RetypePassword"))
if UserName="" then Message=Message&"
您的用户名没有填写
"
if UserEmail="" then Message=Message&"
您的Email没有填写
"
if Len(UserName) < SiteConfig("UserNameMinLength") then Message=Message&"
"
if UserName <> Request.QueryString("UserName") then Message=Message&"
用户名中不能含有URL所不能传送的特殊符号
"
if instr(UserEmail,"@")=0 then Message=Message&"
您的电子邮箱地址填写错误
"
errorchar=array(" ","","","","","","|","`","#","%","&","+")
for i=0 to ubound(errorchar)
if instr(username,errorchar(i))>0 then Message=Message&"
用户名中不能含有特殊符号
"
next
if SiteConfig("BannedRegUserName")<>"" then
filtrate=split(""&SiteConfig("BannedRegUserName")&"","|")
for i = 0 to ubound(filtrate)
if instr(UserName,filtrate(i))>0 then Message=Message&"
用户名中不能含有系统禁止注册的字符“"&filtrate(i)&"”
"
next
end if
if SiteConfig("EnableAntiSpamTextGenerateForRegister")=1 then
if Request.Form("VerifyCode")<>Session("VerifyCode") or Session("VerifyCode")="" then Message=Message&"
验证码错误!
"
end if
if SiteConfig("AccountActivation")=1 then
Randomize
password=int(rnd*999999)+1
else
if Len(password)<6 then Message=Message&"
密码必须至少包含 6 个字符
"
if password<>RetypePassword then Message=Message&"
您 2 次输入的密码不相同
"
end if
if Message<>"" then error(""&Message&"")
if not Conn.Execute("Select UserID From [BBSXP_Users] where UserName='"&UserName&"'" ).eof Then Message=Message&"
"&UserName&" 已经被别人注册了"
If not Conn.Execute("Select UserID From [BBSXP_Users] where UserEmail='"&UserEmail&"'" ).eof Then Message=Message&"
"&UserEmail&" 已经被别人注册了"
if Message<>"" then error(""&Message&"")
UserInfoList=UserInfoList&""&vbCrlf
UserInfoList=UserInfoList&""&vbCrlf
UserInfoList=UserInfoList&""&vbCrlf
UserInfoList=UserInfoList&""&vbCrlf
UserInfoList=UserInfoList&""&vbCrlf
UserInfoList=UserInfoList&""&vbCrlf
Rs.Open "select top 1 * from [BBSXP_Users]",Conn,1,3
Rs.addNew
Rs("UserName")=UserName
Rs("Userpass")=md5(password)
Rs("UserEmail")=UserEmail
Rs("UserInfo")=UserInfoList
Rs("UserFaceUrl")="images/face/Default.gif"
Rs("ReferrerName")=ReferrerName
Rs("ModerationLevel")=SiteConfig("NewUserModerationLevel")
if SiteConfig("AccountActivation")=3 then Rs("UserAccountStatus")=0
Rs("UserRegisterTime")=""&now()&""
Rs("UserRegisterIP")=Request.ServerVariables("REMOTE_ADDR")
Rs("UserActivityTime")=""&now()&""
Rs("UserActivityIP")=Request.ServerVariables("REMOTE_ADDR")
Rs.update
UserID=Rs("UserID")
Rs.close
Session("VerifyCode")=""
UpdateStatistics 1,0,0
NowDate=date()
Conn.execute("update [BBSXP_Statistics] set NewestUserName='"&UserName&"' where DateDiff("&SqlChar&"d"&SqlChar&",DateCreated,"&SqlNowString&")=0")
if SiteConfig("AccountActivation")=0 or SiteConfig("AccountActivation")=2 then
ResponseCookies "UserID",UserID,"9999"
ResponseCookies "Userpass",md5(password),"9999"
end if
if Request("menu")="" and CreateUserAgreement<>"" then
%>