<%@ Language=VBScript %>
<%Option Explicit
Response.Buffer = True
%>
<!-- #INCLUDE FILE = "inc.asp" -->
<!-- #INCLUDE FILE = "config.asp" -->
<%
Dim sNickName, bSex, bShowSex, iGUID
Dim dtBirthday, bShowAge, sEmail, sPortrait, sAboutMe

iGUID = Request.Form("GUID")
sNickName = Trim(Request.Form("NickName"))
bSex = Request.Form("Sex")
bShowSex = Request.Form("ShowSex")
dtBirthday = Request.Form("Birthday")
bShowAge = Request.Form("ShowAge")
sEmail = Trim(Request.Form("Email"))
sPortrait = Request.Form("Portrait")
sAboutMe = Request.Form("AboutMe")
If sNickName = "大家" Then err("非法昵称，请另选好名！")
Dim oChat
Set oChat = Server.CreateObject("LSChat.Users")
oChat.Configure g_SiteName, g_SiteDomain, g_DBString, g_ErrFile, g_ScriptName
Dim rstChatUser

Set rstChatUser = oChat.GetChatUser(iGUID)
If Not rstChatUser.EOF Then
	rstChatUser.Close
	Set rstChatUser = Nothing
	Set oChat = Nothing
	err("您已经激活了聊天账号，请重新登陆。")
Else
	rstChatUser.Close
	Set rstChatUser = oChat.GetChatUserByNickName(sNickName)
	If Not rstChatUser.EOF Then
		rstChatUser.Close
		Set rstChatUser = Nothing
		Set oChat = Nothing
		err("已经有人使用了这个昵称，请重新选择。")
	Else
		Response.Write iGUID
		'Response.End
		rstChatUser.AddNew
		rstChatUser("NickName") = sNickName
		rstChatUser("GUID") = iGUID
		rstChatUser("Sex") = bSex
		rstChatUser("ShowSex") = bShowSex
		rstChatUser("Birthday") = dtBirthday
		rstChatUser("ShowAge") = bShowAge
		rstChatUser("Email") = sEmail
		rstChatUser("Portrait") = sPortrait
	
		rstChatUser("ChatGroup") = "Users"
		rstChatUser("State") = 1
		rstChatUser("LastLogin") = Now()
		rstChatUser("FreeTime") = Now()
		rstChatUser("Logins") = 0
		rstChatUser("ChatMinutes") = 0
		rstChatUser("ChatWords") = 0
		rstChatUser("ChatMessages") = 0
		rstChatUser("AboutMe") = sAboutMe
		rstChatUser.Update
		rstChatUser.Close
		Set rstChatUser = Nothing
	End If
End If
Set oChat = Nothing
%>
<html>
<head>
<script src="inc.js" language="javascript"></script>
<script>document.write("<title>"+Title+"</title>");</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="common.css">
</head>
<body <%=g_BodyTag%>>
<!-- #INCLUDE File = "top.asp" -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td align="left">
    恭喜，您已经激活了聊天账号，您的昵称为<b><%=sNickName%></b>。请<a href="default.asp">返回</a>进入聊天室。
    </td>
  </tr>
</table>
<br>
<!-- #INCLUDE File = "bottom.asp" -->
</body>
</html>