<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("cansuperuser")="" Then
	ef=True
	ec="您没有此操作的权限。"
elseIf Request.Form ("username")="" or RegExpTest("[^A-Za-z0-9]",Request.Form ("username")) Then
	ef=True
	ec="用户名没填或非法！"
'elseIf Request.Form ("password")="" Then
'	ef=True
'	ec="密码没填或非法！"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
Set dsreg = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_AGENT where username='"&Request.Form ("username")&"'"
		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		dsreg.Open Sql,conn,1,3
If not dsreg.Eof Then
		ef=True
		ec="这个用户名已经被别人注册了，请另外换一个用户名吧！"
end if
'user test
Set dsreg = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_USER where username='"&Request.Form ("username")&"'"
		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		dsreg.Open Sql,conn,1,3
If not dsreg.Eof Then
		ef=True
		ec="这个用户名已经被别人注册了，请另外换一个用户名吧！"
end if

end if

if not ef then
Set dsreg = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Admuser where superuser='"&Request.Form ("username")&"'"
if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
'Response.Write sql
'Response.End
		dsreg.Open Sql,conn,1,3
'If not dsreg.Eof Then
'		ef=True
'		ec="用户已存在！"
'end if
end if


if not ef then

If dsreg.Eof then
dsreg.AddNew
dsreg("superuser")=trim(request.Form ("username"))
end if

if trim(request.Form ("password"))<>"" then dsreg("password")=md5(trim(request.Form ("password")))


dsreg("canmodifyhtml")=trim(request.Form ("canmodifyhtml"))
dsreg("cancheckmoney")=trim(request.Form ("cancheckmoney"))
dsreg("canaddmoney")=trim(request.Form ("canaddmoney"))
dsreg("candelmoney")=trim(request.Form ("candelmoney"))
dsreg("cansetserver")=trim(request.Form ("cansetserver"))
dsreg("canrebuild")=trim(request.Form ("canrebuild"))
dsreg("canmodpass")=trim(request.Form ("canmodpass"))
dsreg("canadmuser")=trim(request.Form ("canadmuser"))
dsreg("canshowuser")=trim(request.Form ("canshowuser"))
dsreg("canuserpass")=trim(request.Form ("canuserpass"))
dsreg("candeluser")=trim(request.Form ("candeluser"))
dsreg("canmailuser")=trim(request.Form ("canmailuser"))
dsreg("canshowpro")=trim(request.Form ("canshowpro"))
dsreg("cansetpro")=trim(request.Form ("cansetpro"))

dsreg("canadmhost")=trim(request.Form ("canadmhost"))
dsreg("canadmhostadd")=trim(request.Form ("canadmhostadd"))
dsreg("canadmhostset")=trim(request.Form ("canadmhostset"))

dsreg("canadmdomain")=trim(request.Form ("canadmdomain"))
dsreg("candomainpay")=trim(request.Form ("candomainpay"))
dsreg("candomaindel")=trim(request.Form ("candomaindel"))

dsreg("canadmemail")=trim(request.Form ("canadmemail"))
dsreg("canadmemailadd")=trim(request.Form ("canadmemailadd"))
dsreg("canadmemailset")=trim(request.Form ("canadmemailset"))

dsreg("canadmidc")=trim(request.Form ("canadmidc"))
dsreg("canadmidcadd")=trim(request.Form ("canadmidcadd"))
dsreg("canadmidcset")=trim(request.Form ("canadmidcset"))


dsreg("canadmsql")=trim(request.Form ("canadmsql"))
dsreg("canadmsqladd")=trim(request.Form ("canadmsqladd"))
dsreg("canadmsqlset")=trim(request.Form ("canadmsqlset"))

dsreg("cansetnews")=trim(request.Form ("cansetnews"))
dsreg("canadmlog")=trim(request.Form ("canadmlog"))
dsreg("canagnper")=trim(request.Form ("canagnper"))

dsreg("canadmagn")=trim(request.Form ("canadmagn"))
dsreg("canshowagn")=trim(request.Form ("canshowagn"))
dsreg("canagnpass")=trim(request.Form ("canagnpass"))
dsreg("cansetagn")=trim(request.Form ("cansetagn"))
dsreg("cansuperuser")=trim(request.Form ("cansuperuser"))
dsreg("canadmOther")=trim(request.Form ("canadmOther"))
dsreg("cansysteminfo")=trim(request.Form ("cansysteminfo"))
dsreg("canaws")=trim(request.Form ("canaws"))

dsreg("canmoneyNew")=trim(request.Form ("canmoneyNew"))
dsreg("canmoneyA")=trim(request.Form ("canmoneyA"))
dsreg("canmoneyB")=trim(request.Form ("canmoneyB"))
dsreg("canmoneyC")=trim(request.Form ("canmoneyC"))
dsreg("canmoneyD")=trim(request.Form ("canmoneyD"))
dsreg("canmoneyE")=trim(request.Form ("canmoneyE"))
dsreg("canmoneyF")=trim(request.Form ("canmoneyF"))
dsreg("canmoneyG")=trim(request.Form ("canmoneyG"))
dsreg("canmoneyH")=trim(request.Form ("canmoneyH"))
dsreg("canmoneyI")=trim(request.Form ("canmoneyI"))
dsreg("canmoneyJ")=trim(request.Form ("canmoneyJ"))
dsreg("canmoneyK")=trim(request.Form ("canmoneyK"))

dsreg("canadmkefu")=trim(request.Form ("canadmkefu"))
dsreg("canmodkefu")=trim(request.Form ("canmodkefu"))
dsreg("candelkefu")=trim(request.Form ("candelkefu"))

dsreg("canchnkefu")=trim(request.Form ("canchnkefu"))
dsreg("onlypasusesite")=trim(request.Form ("onlypasusesite"))

dsreg("canadmhostch")=trim(request.Form ("canadmhostch"))
dsreg("canadmhostmidsub")=trim(request.Form ("canadmhostmidsub"))
dsreg("canadmhostmiddomain")=trim(request.Form ("canadmhostmiddomain"))
dsreg("canadmhostmidcpu")=trim(request.Form ("canadmhostmidcpu"))
dsreg("canadmhostmidrepay")=trim(request.Form ("canadmhostmidrepay"))
dsreg("canadmhostdel")=trim(request.Form ("canadmhostdel"))
dsreg("canadmhostoth")=trim(request.Form ("canadmhostoth"))


dsreg("canadmemailreapy")=trim(request.Form ("canadmemailreapy"))
dsreg("canadmemaildel")=trim(request.Form ("canadmemaildel"))
dsreg("canadmemailch")=trim(request.Form ("canadmemailch"))
dsreg("canadmemailrenow")=trim(request.Form ("canadmemailrenow"))
dsreg("canadmemailupdate")=trim(request.Form ("canadmemailupdate"))

dsreg("canadmsqlrepay")=trim(request.Form ("canadmsqlrepay"))
dsreg("canadmsqldel")=trim(request.Form ("canadmsqldel"))
dsreg("canadmsqlpau")=trim(request.Form ("canadmsqlpau"))
dsreg("canadmsqlch")=trim(request.Form ("canadmsqlch"))
dsreg("canadmsqlrenow")=trim(request.Form ("canadmsqlrenow"))
dsreg("canadmsqlupdate")=trim(request.Form ("canadmsqlupdate"))
dsreg("canadmhostset")=trim(request.Form ("canadmhostset"))

dsreg("canadmhostaddtest")=trim(request.Form ("canadmhostaddtest"))


dsreg("canadmvps")=trim(request.Form ("canadmvps"))
dsreg("canadmvpsadd")=trim(request.Form ("canadmvpsadd"))
dsreg("canadmvpsaddtest")=trim(request.Form ("canadmvpsaddtest"))
dsreg("canadmvpsset")=trim(request.Form ("canadmvpsset"))
dsreg("canadmvpsch")=trim(request.Form ("canadmvpsch"))
dsreg("canadmvpsmidcpu")=trim(request.Form ("canadmvpsmidcpu"))
dsreg("canadmvpsmidrepay")=trim(request.Form ("canadmvpsmidrepay"))
dsreg("canadmvpsdel")=trim(request.Form ("canadmvpsdel"))
dsreg("canadmvpsoth")=trim(request.Form ("canadmvpsoth"))

dsreg("canadmispbeian")=trim(request.Form ("canadmispbeian"))

dsreg("canadmcdn")=trim(request.Form ("canadmcdn"))
dsreg("canadmcdnadd")=trim(request.Form ("canadmcdnadd"))
dsreg("canadmcdnaddtest")=trim(request.Form ("canadmcdnaddtest"))
dsreg("canadmcdnset")=trim(request.Form ("canadmcdnset"))
dsreg("canadmcdnch")=trim(request.Form ("canadmcdnch"))
dsreg("canadmcdnmidcpu")=trim(request.Form ("canadmcdnmidcpu"))
dsreg("canadmcdnmidrepay")=trim(request.Form ("canadmcdnmidrepay"))
dsreg("canadmcdndel")=trim(request.Form ("canadmcdndel"))
dsreg("canadmcdnoth")=trim(request.Form ("canadmcdnoth"))

dsreg("ver")=Application("ver")
dsreg("vertime")=Application("vertime")

dsreg.Update
dsreg.Close
set dsreg=nothing
conn.Close 
set conn=nothing

Response.Redirect "superlistuser.asp?finish=ok"
end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>