<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/User_Setup.asp -->
<!-- #include file=../inc/Ubbcode.asp -->
<!-- #include file=../inc/Board_popfun.asp -->
<!-- #include file=inc/User_fun.asp -->
<!-- #include file=inc/UserTopic.asp -->
<!-- #include file=inc/Mail_fun.asp -->
<!-- #include file=../inc/Constellation2.asp -->
<%
DEF_BBS_HomeUrl = "../"

Form_FaceWidth = DEF_AllFaceMaxWidth
Form_FaceHeight = DEF_AllFaceMaxWidth
GBL_CHK_PWdFlag = 0
initDatabase
GBL_CHK_TempStr = ""

SiteHead(DEF_SiteNameString & " - 用户会员区")
UpdateOnlineUserAtInfo GBL_board_ID,"注册新用户"

Dim AttestNumber
AttestNumber = 0
Dim Form_ID

UserTopicTopInfo
DisplayUserNavigate("新用户注册")

If LMT_EnableRegNewUsers = 1 Then
	If Request.form("JoinFlag") <> "" Then
		If Request.Form("SubmitFlag")="29d98Sasphouseasp8asphnet" Then
			GBL_CHK_TempStr = ""
			ApplyFlag = 1
			checkFormDate
			
			If GBL_CHK_Flag = 0 Then
				Response.WRite "<p><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>" & VbCrLf
				JoinForm
			Else
				If saveFormData = 1 Then
					displayAccessFull
				Else
					Response.WRite "<p><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>" & VbCrLf
					JoinForm
				End If
			End If
		Else
			JoinForm
		End If
	Else
		DisplayUserAgreement
	End If
Else
	Response.Write "<p><br>论坛停止新用户注册中，请联系管理员．"
End If
UserTopicBottomInfo
closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

Function DisplayUserAgreement

	%><p><form action=UserJoin.asp method=post>
	<input name=JoinFlag type=hidden value=dkls>
<!-- #include file=inc/User_Reg.asp -->
<input type="submit" value="我同意" class=fmbtn></form>
	<%

End Function

Function JoinForm%>

	<script LANGUAGE="JavaScript" TYPE="text/javascript">
	function setface() 
	{
		window.open('facelist.asp','','width=250,height=450 scrollbars=auto,status=no');
	}
	</script>

	<script language=JavaScript>
	<!--
	var ValidationPassed = true;
	function isnum(str)
	{
		rset="";
		for(i=0;i<str.length;i++)
		{
			if(str.charAt(i)>="0" && str.charAt(i)<="9")
			{
			}
			else
			{
				return 0;
			}
		}
		return 1;
	}

	function changeface()
	{
		var temp;
		temp=document.LeadBBSFm.Form_userphoto.value;
		if (temp!="" && isnum(temp)==1 && temp.length==4)
		{
			if (parseInt(temp) > 0 && parseInt(temp) <= <%=DEF_faceMaxNum%>)
			{
				document.faceimg.src='<%=DEF_BBS_HomeUrl%>images/face/'+temp+'.gif';
			}
			else
			{
				alert("错误!此图像代号不存在!");
				document.faceimg.src='<%=DEF_BBS_HomeUrl%>images/null.gif';
				document.LeadBBSFm.Form_userphoto.value='';
				ValidationPassed = false;
			}
		}
		else
		{
			alert("错误!此图像代号不存在!\n图像代号必须是4位数<%if len(Cstr(DEF_faceMaxNum))>4 then Response.Write "或以上"%>,比如 0001 ,最大为<%=DEF_faceMaxNum%>");
			document.faceimg.src='<%=DEF_BBS_HomeUrl%>images/null.gif';
			document.LeadBBSFm.Form_userphoto.value='';
			ValidationPassed = false;
		}
	}
	<%If DEF_AllDefineFace = 1 Then%>
	function changeface2()
	{
		var temp,obj;
		obj=document.LeadBBSFm;
		if(obj.Form_FaceWidth.value!="")
		{
			if (! isnum(obj.Form_FaceWidth.value))
			{
				alert("自定义头像宽度必须是数字！\n");
				obj.Form_FaceWidth.focus();
				return;
			}
			else
			{
				if(obj.Form_FaceWidth.value<20 || obj.Form_FaceWidth.value><%=DEF_AllFaceMaxWidth%>)
				{
					alert("自定义头像宽度必须在20-<%=DEF_AllFaceMaxWidth%>之间！\n");
					obj.Form_FaceWidth.focus();
					return;
				}
			}
		}

		if(obj.Form_FaceHeight.value!="")
		{
			if (! isnum(obj.Form_FaceHeight.value))
			{
				alert("自定义头像高度必须是数字！\n");
				obj.Form_FaceHeight.focus();
				return;
			}
			else
			{
				if(obj.Form_FaceHeight.value<20 || obj.Form_FaceHeight.value><%=DEF_AllFaceMaxWidth%>)
				{
					alert("自定义头像高度必须在20-<%=DEF_AllFaceMaxWidth%>之间！\n");
					obj.Form_FaceHeight.focus();
					return;
				}
			}
		}

		temp=document.LeadBBSFm.Form_FaceUrl.value;
		if (temp!="")
		{
			document.faceimg.src=temp;
			document.faceimg.width=obj.Form_FaceWidth.value;
			document.faceimg.height=obj.Form_FaceHeight.value;
		}
	}
	<%End If%>

	function form_onsubmit(obj)
	{
		if(obj.Form_username.value=="")
		{
			alert("请输入你的用户名!\n");
			ValidationPassed = false;
			obj.Form_username.focus();
			return;
		}
		
		if(obj.Form_username.value.length<(<%=DEF_ShortestUserName%>/2))
		{
			alert("用户名长度至少需要<%=DEF_ShortestUserName%>个字符!\n");
			ValidationPassed = false;
			obj.Form_username.focus();
			return;
		}

		if(obj.Form_mail.value=="")
		{
			alert("请输入你的真实邮箱地址！\n");
			ValidationPassed = false;
			obj.Form_mail.focus();
			return;
		}

		if(obj.Form_password1.value=="")
		{
			alert("请输入你的密码!\n");
			ValidationPassed = false;
			obj.Form_password1.focus();
			return;
		}

		if(obj.Form_password2.value=="")
		{
			alert("请输入你的验证密码！\n");
			ValidationPassed = false;
			obj.Form_password2.focus();
			return;
		}

		if(obj.Form_password1.value!=obj.Form_password2.value)
		{
			alert("你的两次密码输入不相同！\n");
			ValidationPassed = false;
			obj.Form_password1.focus();
			return;
		}

		if(obj.Form_Question.value=="")
		{
			alert("请输入密码提示!\n");
			ValidationPassed = false;
			obj.Form_Question.focus();
			return;
		}

		if(obj.Form_Answer.value=="")
		{
			alert("请输入提示答案!\n");
			ValidationPassed = false;
			obj.Form_Answer.focus();
			return;
		}
		if(obj.Form_icq.value!="")
		{
			if (! isnum(obj.Form_icq.value))
			{
				alert("喂,你填入了ICQ框中填入了东西,但你的ICQ号码怎么不是数字！\n");
				ValidationPassed = false;
				obj.Form_icq.focus();
				return;
			}
		}

		if(obj.Form_oicq.value!="")
		{
			if (! isnum(obj.Form_oicq.value))
			{
				alert("喂,你填入了ＱＱ框中填入了东西,但你的ＱＱ号码怎么不是数字?\n");
				ValidationPassed = false;
				obj.Form_oicq.focus();
				return;
			}
		}

		if(obj.Form_byear.value!="")
		{
			if (! isnum(obj.Form_byear.value))
			{
				alert("喂,你填入了你的出生年,但你的年份怎么不是数字！\n");
				ValidationPassed = false;
				obj.Form_byear.focus();
				return;
			}
		}

		if(obj.Form_bmonth.value!="")
		{
			if (! isnum(obj.Form_bmonth.value))
			{
				alert("喂,你填入了你的出生月,但你的月份怎么不是数字！\n");
				ValidationPassed = false;
				obj.Form_bmonth.focus();
				return;
			}
		}

		if(obj.Form_bday.value!="")
		{
			if (! isnum(obj.Form_bday.value))
			{
				alert("喂,你填入了你的出生日,但你的出生日怎么不是数字！\n");
				ValidationPassed = false;
				obj.Form_bday.focus();
				return;
			}
		}

		if(obj.Form_userphoto.value!="")
		{
			if (! isnum(obj.Form_bday.value))
			{
				alert("用户图像,只能是001-318之间的数字！\n");
				ValidationPassed = false;
				obj.Form_bday.focus();
				return;
			}
		}
		
		if(obj.Form_Underwrite.value.length>255)
		{
			alert("用户签名内容要小于255个字符!\n");
			ValidationPassed = false;
			obj.Form_Underwrite.focus();
			return;
		}
		<%If DEF_AllDefineFace = 1 Then%>
		if(obj.Form_FaceWidth.value!="")
		{
			if (! isnum(obj.Form_FaceWidth.value))
			{
				alert("自定义头像宽度必须是数字！\n");
				ValidationPassed = false;
				obj.Form_FaceWidth.focus();
				return;
			}
			else
			{
				if(obj.Form_FaceWidth.value<20 || obj.Form_FaceWidth.value><%=DEF_AllFaceMaxWidth%>)
				{
					alert("自定义头像宽度必须在20-<%=DEF_AllFaceMaxWidth%>之间！\n");
					ValidationPassed = false;
					obj.Form_FaceWidth.focus();
					return;
				}
			}
		}

		if(obj.Form_FaceHeight.value!="")
		{
			if (! isnum(obj.Form_FaceHeight.value))
			{
				alert("自定义头像高度必须是数字！\n");
				ValidationPassed = false;
				obj.Form_FaceHeight.focus();
				return;
			}
			else
			{
				if(obj.Form_FaceHeight.value<20 || obj.Form_FaceHeight.value><%=DEF_AllFaceMaxWidth%>)
				{
					alert("自定义头像高度必须在20-<%=DEF_AllFaceMaxWidth%>之间！\n");
					ValidationPassed = false;
					obj.Form_FaceHeight.focus();
					return;
				}
			}
		}<%End if
                     If DEF_EnableAttestNumber > 2 Then%>

		
		if(obj.ForumNumber.value=="")
		{
			alert("请输入验证码!\n");
			ValidationPassed = false;
			obj.ForumNumber.focus();
			return;
           }<%End If%>
alert("祝您注册成功！");
		ValidationPassed = true;
		return true;
	}

	function submitonce(theform)
	{
		form_onsubmit(theform);
		if(ValidationPassed == false)return;
		if (document.all||document.getElementById)
		{
			for (i=0;i<theform.length;i++)
			{
				var tempobj=theform.elements[i];
				if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
				tempobj.disabled=true;
			}
		}
	}
	-->
	</script>

<FORM action=UserJoin.asp method=post name=LeadBBSFm onSubmit="submitonce(this);return ValidationPassed;">
	<p><b>新用户注册</b><br>
	<br>
	</p>
	<TABLE border=0 cellpadding="0" cellspacing="0">
	<TR align=middle>
		<TD colspan="2">
			<TABLE border=0 class=font width="100%" cellpadding="0" cellspacing="0">
			<TR>
				<TD height=2 bgcolor="#ececff" class=TBBG1><img src="<%=DEF_BBS_HomeUrl%>images/null.GIF" height=1></TD>
				<TD height=2 bgcolor="#ececff" class=TBBG1><img src="<%=DEF_BBS_HomeUrl%>images/null.GIF" height=1></TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>*用户名称： 
				</TD>
				<TD height="25">
					<p>
					<input class=fminpt maxLength=14 name="Form_username" size=14 Value="<% If Form_username<>"" Then Response.Write Server.HtmlEncode(Form_Username)%>">
				</TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>*你的密码： 
				</TD>
				<TD height="25">
					<input class=fminpt name=SubmitFlag type=hidden value="29d98Sasphouseasp8asphnet">
					<input class=fminpt name=JoinFlag type=hidden value="3kkdk">
					<input class=fminpt maxLength=20 name="Form_password1" size=14 type=password Value="<% If Form_password1<>"" Then Response.Write Server.HtmlEncode(Form_password1)%>">
				</TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>*验证密码： 
				</TD>
				<TD height="25">
					<input class=fminpt maxlength=20 name="Form_password2" size=14 type=password Value="<% If Form_password2<>"" Then Response.Write Server.HtmlEncode(Form_password2)%>">
				</TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>*电子邮件： 
				</TD>
				<TD height="25">
					<input class=fminpt maxLength=60 name=Form_mail size=36 Value="<% If Form_mail<>"" Then Response.Write Server.HtmlEncode(Form_mail)%>">
<input type=button onclick="form.Form_mail.value=Math.round(Math.random()*100000)+'@nocolor.cn'" value=替我填写>
				</TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>*密码提示： 
				</TD>
				<TD height="25">
					<input class=fminpt maxLength=20 name=Form_Question size=36 Value="<% If Form_Question<>"" Then Response.Write Server.HtmlEncode(Form_Question)%>">
				</TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>*提示答案：
				</TD>
				<TD height="25">
					<input class=fminpt maxlength=20 name=Form_Answer size=36 Value="<% If Form_Answer<>"" Then Response.Write Server.HtmlEncode(Form_Answer)%>">
				</TD>
			</TR>
<script language=javascript>
     function sss(obj)
     {
           if(obj.style.display == "none")
           {
                 obj.style.display = "block";
           }
           else
           {
                 obj.style.display = "none";
           }
     }
     </script>

                 <TR>
                       <TD height="40" colspan=2><BR>
                             下面的内容您可以选择填写，以便享受为你提供的更多服务！
                             <CENTER><span  style="cursor:hand" onclick="sss(document.all.Userjion)">—————— <FONT COLOR="#000000">您可以点击这里填写更加详细的资料</FONT> ——————</span></CENTER><BR>
                       </TD>
                 </TR>
                 </table>

     <span name=Userjion ID=Userjion style='display:none'>

                 <TABLE border=0 class=font width="100%" cellpadding="0" cellspacing="0">
			<TR>
				<TD height="25" align=center>
					<p>个人主页：
				</TD>
				<TD height="25">
					<input class=fminpt maxlength=250 name=Form_homepage size=36 Value="<% If Form_homepage<>"" Then Response.Write Server.HtmlEncode(Form_homepage)%>">
				</TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>ICQ 号码：
				</TD>
				<TD height="25">
					<input class=fminpt maxlength=10 name=Form_icq size=36 Value="<% If Form_icq<>"" Then Response.Write Server.HtmlEncode(Form_icq)%>">
				</TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>ＱＱ号码：
				</TD>
				<TD height="25">
					<input class=fminpt maxlength=10 name=Form_oicq size=14 Value="<% If Form_oicq<>"" Then Response.Write Server.HtmlEncode(Form_oicq)%>"> * <FONT COLOR="#000000">填写QQ号码后将在论坛中显示您的QQ秀哦 ^o^</font>
				</TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>联系地址：
				</TD>
				<TD height="25">
					<input class=fminpt maxlength=150 name=Form_address size=36 Value="<% If Form_address<>"" Then Response.Write Server.HtmlEncode(Form_address)%>">
				</TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>你的性别：
				</TD>
				<TD height="25">
					<select name="Form_sex">
						<option value="密">保密</option>
						<option value="男" <% If Form_sex = "男" Then Response.Write "selected"%>>男</option>
						<option value="女" <% If Form_sex = "女" Then Response.Write "selected"%>>女</option>
					</select>
				</TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>用户头像：
				</TD>
				<TD height="25">
					<input class=fminpt onchange="javascript:changeface();" maxlength=4 name=Form_userphoto size=4 Value="<% If Form_userphoto<>"" Then Response.Write Server.HtmlEncode(string(4-len(cstr(Form_userphoto)),"0")&Form_userphoto)%>">
					<span style='cursor:hand' title='查看头像代号' onclick="setface();">查看头像代号</span>
					<%If Form_userphoto<>"" and isNumeric(Form_userphoto) Then%><img name=faceimg id=faceimg src=<%=DEF_BBS_HomeUrl%>images/face/<%=string(4-len(cstr(Form_userphoto)),"0")&Form_userphoto%>.gif align=absmiddle width=62 height=62><%Else%><img name=faceimg id=faceimg src=<%=DEF_BBS_HomeUrl%>images/null.gif align=absmiddle><%End If%>
				</TD>
			</TR><%If DEF_AllDefineFace = 1 Then%>
			<TR>
				<TD height="25" align=center>
					<p>自定头像：
				</TD>
				<TD height="25">
					<input class=fminpt onchange="javascript:changeface2();" maxlength=250 name=Form_FaceUrl size=36 Value="<%=HtmlEncode(Form_FaceUrl)%>">
				</TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>头像大小：
				</TD>
				<TD height="25">
					宽: <input class=fminpt onchange="javascript:changeface2();" maxlength=<%=len(DEF_AllFaceMaxWidth)%> name=Form_FaceWidth size=3 Value="<%=HtmlEncode(Form_FaceWidth)%>">(20-<%=DEF_AllFaceMaxWidth%>)
					高: <input class=fminpt onchange="javascript:changeface2();" maxlength=<%=len(DEF_AllFaceMaxWidth)%> name=Form_FaceHeight size=3 Value="<%=HtmlEncode(Form_FaceHeight)%>">(20-<%=DEF_AllFaceMaxWidth%>)
				</TD>
			</TR><%End If%>
			<TR>
				<TD height="25" align=center>
					<p>你的生日： 
				</TD>
				<TD height="25" align="left">
					<p>
					<input class=fminpt maxlength=4 name=Form_byear size=4 Value="<% If Form_byear<>"" Then
						Response.Write Server.HtmlEncode(Form_byear)
					Else
						Response.Write "19"
					End If%>"> 年 
					<input class=fminpt maxlength=2 name=Form_bmonth size=2 Value="<% If Form_bmonth<>"" Then Response.Write Server.HtmlEncode(Form_bmonth)%>">
					月 <input class=fminpt maxlength=2 name=Form_bday size=2 Value="<% If Form_bday<>"" Then Response.Write Server.HtmlEncode(Form_bday)%>">
					日</TD>
			</TR>
			<TR>
				<TD height="25" align=center>
					<p>签名-UBB：
				</TD>
				<TD height="25">
					<textarea class=fmtxtra name=Form_Underwrite rows=5 cols=34><%If Form_Underwrite <> "" Then Response.Write VbCrLf & htmlEncode(Form_Underwrite)%></textarea>
				</TD>
</TR>
                 </table>
           </span>                  
                 
                 <TABLE border=0 class=font width="100%" cellpadding="0" cellspacing="0">
                 <%If DEF_EnableAttestNumber > 2 Then%>
                 <TR>
                       <TD height="25" align=center>
                             <p>验 证 码：
				</TD>
				<TD height="25">
					<TABLE border=0 class=font width="100%" cellpadding="0" cellspacing="0">
					<TR>
						<TD>
						<input name=ForumNumber maxlength=4 size=4 value="<%=htmlencode(Request("RndNumber"))%>" class=fminpt></td>
						<td>&nbsp;请在框中输入<img src=<%=DEF_BBS_HomeUrl%>User/number.asp?n=<%=timer%> align=absmiddle width=32 height=12>，否则无法注册</td></tr></table>
				</TD>
                 </TR><%End If%>
			</TABLE>
		</TD>
	</TR>
	<TR>
		<TD>&nbsp;</TD>
		<TD width="95%" height="30" align="center">
			<input name=submit type=submit value=" 申 请 " class=fmbtn>
			<input name=b1 type=reset value=" 重 写 " class=fmbtn>
		</TD>
	</TR>
	<TR>
		<TD colspan="2" height=2 bgcolor="ececff" class=TBBG1><img src="<%=DEF_BBS_HomeUrl%>images/null.GIF" width=1 height=1></TD>
	</TR>
	</TABLE>
</FORM>
<%
End Function

Function saveFormData

	Dim Rs
	Set Rs = Server.CreateObject("ADODB.RecordSet")
	Rs.Open "Select top 1 * from LeadBBS_User",con,2,2
	Rs.Addnew
	Rs("UserName") = Form_UserName
	If Form_Mail<>"" Then Rs("Mail") = Form_Mail
	If Form_Address<>"" Then Rs("Address") = Form_Address
	Rs("Sex") = Form_Sex
	If Form_ICQ<>"" Then Rs("ICQ") = Form_ICQ
	If Form_OICQ<>"" Then Rs("OICQ") = Form_OICQ
	Rs("Userphoto") = Form_Userphoto
	If Form_Homepage<>"" Then Rs("Homepage") = Form_Homepage
	If Form_Underwrite<>"" Then Rs("Underwrite") = Form_Underwrite
	If Form_PrintUnderwrite<>"" Then Rs("PrintUnderwrite") = Form_PrintUnderwrite
	Rs("Pass") = MD5(Form_Password1)
	If len(Form_birthday)=14 Then
		Rs("birthday") = Form_birthday
		Dim Temp
		temp = cCur(Left(Form_birthday,4))
		If temp > 1950 and temp < 2050 Then Rs("NongLiBirth") = GetTimeValue(ConvertToNongLi(RestoreTime(Form_birthday)))
	End If

	REM 特殊数据
	Rs("ApplyTime") = Form_ApplyTime
	Rs("IP") = Form_IP
	Rs("UserLevel") = Form_UserLevel
	Rs("Officer") = Form_Officer
	Rs("Points") = DEF_User_RegPoints
	Rs("Sessionid") = Form_Sessionid
	Rs("Online") = Form_Online
	Rs("Prevtime") = Form_Prevtime
	Rs("Answer") = MD5(Form_Answer)
	Rs("Question") = Form_Question
	Rs("LastDoingTime") = Form_ApplyTime
	Rs("LastWriteTime") = Form_ApplyTime
	If DEF_UserNewRegAttestMode > 0 Then
		Rs("UserLimit") = 1
	Else
		Rs("UserLimit") = 0
	End If

	If DEF_AllDefineFace = 1 Then
		Rs("FaceUrl") = Form_FaceUrl
		Rs("FaceWidth") = Form_FaceWidth
		Rs("FaceHeight") = Form_FaceHeight
	End If
	Rs("LastAnnounceID") = 0

	Rs.Update

	Rs.Close
	Set Rs = Nothing
	<!--新用户欢迎开始-->
dim fromuser,touser,title,content
           fromuser=DEF_SiteNameString
           touser=Replace(Form_UserName,"'","''")
           Title=DEF_SiteNameString&" 欢迎您！"
           Content="欢迎您！希望你会喜欢这里并停留下来！多多灌水，开心最重要！QQ群：13672598，等待您的加入！"
           con.execute("insert into LeadBBS_InfoBox(FromUser,ToUser,Title,Content,IP,SendTime,ReadFlag) values('"&fromuser&"','"&touser&"','"&Title&"','"&Content&"','" & GBL_IPAddress & "'," & GetTimeValue(now) & ",0)")
           con.execute("update leadbbs_user set messageflag=1 where username='"&Form_UserName&"'")
<!--新用户欢迎结束-->
	
	Set Session(DEF_MasterCookies & "UDT") = Nothing
	Session(DEF_MasterCookies & "UDT") = ""
	
	Set Rs = Con.ExeCute("Select top 1 ID from LeadBBS_User Where UserName='" & Replace(Form_UserName,"'","''") & "'")
	If Not Rs.Eof Then
		Form_ID = Rs(0)
	Else
		Form_ID = 0
	End If
	Rs.Close
	Set Rs = Nothing
	saveFormData = 1

	Dim Form_ExpiresTime
	If DEF_UserActivationExpiresDay > 0 and DEF_UserActivationExpiresDay < 3650 Then
		Form_ExpiresTime = GetTimeValue(DateAdd("d",DEF_UserActivationExpiresDay,DEF_Now))
	Else
		Form_ExpiresTime = 0
	End If
	If DEF_UserNewRegAttestMode > 0 Then
		If DEF_UserNewRegAttestMode = 1 Then
			Randomize
			AttestNumber = Right(Fix(Rnd*Timer)+Fix(Rnd*cCur(GetTimeValue(DEF_Now))) + 10000,10)
		End If
		Con.ExeCute("insert into LeadBBS_SpecialUser(UserID,UserName,BoardID,Assort,ndatetime,ExpiresTime) values(" & Form_ID & ",'" & Replace(Form_UserName,"'","''") & "'," & AttestNumber & ",6," & GetTimeValue(DEF_Now) & "," & Form_ExpiresTime & ")")
	End If

	Con.ExeCute("Update LeadBBS_SiteInfo Set UserCount=UserCount+1")
	UpdateStatisticDataInfo 1,1,1
	
	SendRegMail

End Function

Sub SendRegMail

	Dim HomeUrl
	HomeUrl = "http://"&Request.ServerVariables("server_name")
	If Request.ServerVariables("SERVER_PORT") <> "80" Then HomeUrl = HomeUrl & ":" & Request.ServerVariables("SERVER_PORT")
	HomeUrl = Lcase(HomeUrl & Request.Servervariables("SCRIPT_NAME"))
	HomeUrl = Replace(HomeUrl,"user/userjoin.asp","")

	Dim MailBody,Topic,TextBody
	Topic = "您在" & DEF_SiteNameString & "的成功注册资料"
	MailBody = "<html>"
	TextBody = ""
	MailBody = MailBody & "<TITLE>注册信息</TITLE>"
	MailBody = MailBody & "<BODY>"
	MailBody = MailBody & "<TABLE BORDER=0 WIDTH=95% ALIGN=CENTER><TBODY><TR>"
	MailBody = MailBody & "<TD VALIGN=MIDDLE ALIGN=TOP><HR WIDTH=100% SIZE=1>"
	TextBody = TextBody & "------------------------------------------" & VbCrLf
	MailBody = MailBody & VbCrLf & "<b>" & htmlencode(Form_UserName)&"，您好</b>：<BR><BR>"
	TextBody = TextBody & htmlencode(Form_UserName)&"，您好：" & VbCrLf & VbCrLf
	MailBody = MailBody & "谢谢您注册本论坛，下面是您的注册信息！<BR><BR>"
	TextBody = TextBody & "谢谢您注册本论坛，下面是您的注册信息！" & VbCrLf & VbCrLf
	MailBody = MailBody & "用户名："&htmlencode(Form_UserName)&"<BR>"
	TextBody = TextBody & "用户名："&htmlencode(Form_UserName) & VbCrLf
	MailBody = MailBody & "密　码：" & Form_Password1 & "<BR>"
	TextBody = TextBody & "密　码：" & Form_Password1 & VbCrLf
	If DEF_UserNewRegAttestMode = 1 Then
		MailBody = MailBody & "验证码：" & AttestNumber & "<BR>"
		TextBody = TextBody & "验证码：" & AttestNumber & VbCrLf
		MailBody = MailBody & "<p><b><a href=" & HomeUrl & "User/UserTurnOn.asp?user=" & urlencode(Form_UserName) & ">请点击这里，输入您的注册信息，立即激活您的用户。</a></b><BR>"
		TextBody = TextBody & VbCrLf & VbCrLf & "请输入下列网址，并输入您的注册信息，立即激活您的用户：" & VbCrLf & HomeUrl & "User/UserTurnOn.asp?ID=" & urlencode(Form_UserName) & VbCrLf & VbCrLf
	Else
		MailBody = MailBody & "<p>刚注册的用户需等待网站管理员进行认证才能成为正式会员，在通过之前在功能使用上会有一些限制。<BR>"
		TextBody = TextBody & VbCrLf & VbCrLf & "刚注册的用户需等待网站管理员进行认证才能成为正式会员，在通过验证之前在功能使用上会有一些限制。" & VbCrLf
	End If
	MailBody = MailBody & "<BR><BR>"
	MailBody = MailBody & "<CENTER><FONT COLOR=RED><a href=""" & HomeUrl & """>欢迎经常光临论坛！</a></FONT>"
	MailBody = MailBody & "</TD></TR></TBODY></TABLE><BR><HR WIDTH=95% SIZE=1>"
	MailBody = MailBody & "<P ALIGN=CENTER>" & DEF_SiteNameString & " <a href=http://www.leadbbs.com target=_blank class=NavColor>LeadBBS</a> v3.14</P>"
	TextBody = TextBody & VbCrLf & "论坛网址：" & HomeUrl & VbCrLf
	TextBody = TextBody & "------------------------------------------" & VbCrLf
	MailBody = MailBody & "</BODY>"
	MailBody = MailBody & "</HTML>"
	Select Case DEF_BBS_EmailMode
		Case 1: If SendEasyMail(Form_Mail,Topic,MailBody,TextBody) = 1 Then
					Response.Write "<br><br>资料成功发送到您的注册邮箱！"
				Else
					Response.Write "<br><br>论坛未正确设置邮件发送，资料发送失败！"
				End If
		Case 2: If SendJmail(Form_Mail,Topic,MailBody) = 1 Then
					Response.Write "<br><br>资料成功发送到您的注册邮箱！"
				Else
					Response.Write "<br><br>论坛未正确设置邮件发送，资料发送失败！"
				End If
		Case 3: If SendCDOMail(Form_Mail,Topic,TextBody) = 1 Then
					Response.Write "<br><br>资料成功发送到您的注册邮箱！"
				Else
					Response.Write "<br><br>论坛未正确设置邮件发送，资料发送失败！"
				End If
		Case Else: 
	End Select

End Sub

Function displayAccessFull

	Response.Cookies(DEF_MasterCookies)("user") = Form_Username
	Response.Cookies(DEF_MasterCookies)("pass") = Form_password1
	con.execute("Update LeadBBS_onlineUser set UserID=" & Form_ID & ",UserName='" & Replace(Form_Username,"'","''") & "',HiddenFlag=" & DEF_UserNewRegAttestMode & " where sessionID=" & session.sessionID)%>
	<p>您已经成功注册成为论坛用户，5秒钟后页面将自动返回论坛首页。</a><br>
	<%If DEF_UserNewRegAttestMode = 1 Then
		Response.Write "<p><font color=green class=GreenFont>注册的用户只有浏览论坛的权限，激活用户的验证码已经成功发送到您的注册邮箱。</font>" & VbCrLf
	ElseIf DEF_UserNewRegAttestMode = 2 Then
		Response.Write "<p><font color=green class=GreenFont>注册的用户只有浏览论坛的权限，请等待网站成员对您作出验证才能成为正式会员。</font>" & VbCrLf
	End If%>
	<meta http-equiv=refresh content="5;URL=../Boards.asp">
	<br>
	</p>

<%End Function%>