set rs=server.createobject("adodb.recordset")
If request("ischallenge")="yes" and cint(Dvbbs.Forum_Setting(24))=1 Then
sql="select * from [Dv_user] where username='"&username&"' or useremail='"&useremail&"' or usermobile='"&Dvbbs.CheckStr(request("mobile"))&"'"
ElseIf request("ischallenge")="yes" Then
sql="select * from [Dv_user] where username='"&username&"' or usermobile='"&Dvbbs.CheckStr(request("mobile"))&"'"
ElseIf cint(Dvbbs.Forum_Setting(24))=1 Then
sql="select * from [Dv_user] where username='"&username&"' or useremail='"&useremail&"'"
Else
sql="select * from [Dv_user] where username='"&username&"'"
End If
'Response.Write sql
'response.end
rs.open sql,conn,1,3
If not rs.eof and not rs.bof Then
If Dvbbs.Forum_Setting(24)="1" Then
Dvbbs.AddErrCode(20)
Exit sub
Else
Dvbbs.AddErrCode(21)
Exit Sub
End If
Else
rs.addnew
rs("UserName")=username
rs("UserPassword")=password
rs("UserEmail")=useremail
rs("Userclass")=userclass
rs("TitlePic")=titlepic
rs("UserQuesion")=quesion
rs("UserAnswer")=answer
rs("TruePassWord")=TruePassWord
rs("UserIM")=UserIM
If Request.Form("Signature")<>"" Then rs("UserSign")=Dvbbs.Htmlencode(Trim(Request.Form("Signature")))
rs("UserPost")=0
If Dvbbs.Forum_Setting(25)="1" Then
rs("UserGroupID")=5
Else
rs("UserGroupID")=Dvbbs.UserGroupID
End If