<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
session.Timeout =35
server.ScriptTimeout =240
if request.Form ("username")="freehost" and request.Form ("password")="7i24freehost" then
response.Redirect "modifypass.asp?do=ini"
end if
If Request.Form ("username")="" or RegExpTest("[^A-Za-z0-9]",Request.Form ("username")) Then
	ef=True
	ec="管理员名没填或非法！"
elseIf Request.Form ("password")="" Then
	ef=True
	ec="密码没填！"
ElseIf (Request.Form ("Vcode")<>session("Vcode") or session("Vcode")="") and Request.Cookies("usernamecook")<>request.Form ("username") Then
	ef=True
	ec="验证码不正确！"
End if



if not ef then
session("agentname")="n"
session("agentusername")=""
session("username")=""
session("password")=""
session("AgnRunasUser")=false
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
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
		dsreg.Open Sql,conn,1,3
If dsreg.Eof Then
		ef=True
		ec="用户名不存在！"
end if
end if

if not ef then
if md5(Request.Form ("password"))<>dsreg("password") and Request.Form ("password")<>md5(dsreg("password")&Request.ServerVariables("REMOTE_ADDR")) then
		ef=True
		ec="密码不正确！"
if ef Then 
if Request.Cookies("savename")="y" Then
Response.Cookies("usernamecook")=""
Response.Cookies("password")=""
Response.Cookies("savename")=""
Response.Redirect "default.asp?now="&now
End if
end if
end if
end If

if not ef Then
If Request.Form ("password")=md5(dsreg("password")&Request.ServerVariables("REMOTE_ADDR")) And Request.Cookies("savename")="" Then
		ef=True
		ec="密码不正确！！"
End if
end If

if not ef then

Response.Cookies("usernamecook")=Request.Form("username")
Response.Cookies("url")=Request.ServerVariables("url")

if Request("savename")="y" then
Response.Cookies("password")=md5(dsreg("password")&Request.ServerVariables("REMOTE_ADDR"))
Response.Cookies("savename")="y"
Response.Cookies("password").path="/"
Response.Cookies("password").expires=formatdatetime(dateadd("d",365,now))
Response.Cookies("savename").path="/"
Response.Cookies("savename").expires=formatdatetime(dateadd("d",365,now))
Response.Cookies("usernamecook").path="/"
Response.Cookies("usernamecook").expires=formatdatetime(dateadd("d",365,now))
Response.Cookies("url").path="/"
Response.Cookies("url").expires=formatdatetime(dateadd("d",365,now))
else
Response.Cookies("password")=""
Response.Cookies("savename")=""
end if

session("admau")="7i24.com"
session("admusername")=Request.Form ("username")
session("admpassword")=md5(dsreg("password")&Request.ServerVariables("REMOTE_ADDR"))
session("admtype1")=dsreg("type1")
session("admusername")=dsreg("superuser")
session("atspace")="管理区"


session("lastuse")=dsreg("lastuse")
dsreg("lastuse")=now
dsreg.update











session("canmodifyhtml")=""
session("cancheckmoney")=""
session("canaddmoney")=""
session("candelmoney")=""
session("cansetserver")=""
session("canrebuild")=""
session("canmodpass")=""
session("canadmuser")=""
session("canshowuser")=""
session("canuserpass")=""
session("candeluser")=""
session("canmailuser")=""
session("canshowpro")=""
session("cansetpro")=""

session("canadmhost")=""
session("canadmhostadd")=""
session("canadmhostset")=""

session("canadmdomain")=""
session("candomainpay")=""
session("candomaindel")=""

session("canadmemail")=""
session("canadmemailadd")=""
session("canadmemailset")=""

session("canadmidc")=""
session("canadmidcadd")=""
session("canadmidcset")=""

session("canadmsql")=""
session("canadmsqladd")=""
session("canadmsqlset")=""

session("cansetnews")=""
session("canadmlog")=""
session("canagnper")=""

session("canadmagn")=""
session("canshowagn")=""
session("canagnpass")=""
session("cansetagn")=""
session("cansuperuser")=""
session("canadmOther")=""
session("cansysteminfo")=""

session("canaws")=""

session("canmoneyNew")=""
session("canmoneyA")=""
session("canmoneyB")=""
session("canmoneyC")=""
session("canmoneyD")=""
session("canmoneyE")=""
session("canmoneyF")=""
session("canmoneyG")=""
session("canmoneyH")=""
session("canmoneyI")=""
session("canmoneyJ")=""
session("canmoneyK")=""

session("canadmkefu")=""
session("canmodkefu")=""
session("candelkefu")=""
session("canchnkefu")=""
session("onlypasusesite")=""


session("canadmhostch")=""
session("canadmhostmidsub")=""
session("canadmhostmiddomain")=""
session("canadmhostmidcpu")=""
session("canadmhostmidrepay")=""
session("canadmhostdel")=""
session("canadmhostoth")=""


session("canadmemailreapy")=""
session("canadmemaildel")=""
session("canadmemailch")=""
session("canadmemailrenow")=""
session("canadmemailupdate")=""
session("canadmsqlrepay")=""
session("canadmsqldel")=""
session("canadmsqlpau")=""
session("canadmsqlch")=""
session("canadmsqlrenow")=""
session("canadmsqlupdate")=""
session("canadmhostset")=""
session("canadmhostaddtest")=""


session("canadmvps")=""
session("canadmvpsadd")=""
session("canadmvpsaddtest")=""
session("canadmvpsset")=""
session("canadmvpsch")=""
session("canadmvpsmidcpu")=""
session("canadmvpsmidrepay")=""
session("canadmvpsdel")=""
session("canadmvpsoth")=""
session("canadmispbeian")=""

session("canadmCDN")=""
session("canadmCDNadd")=""
session("canadmCDNaddtest")=""
session("canadmCDNset")=""
session("canadmCDNch")=""
session("canadmCDNmidcpu")=""
session("canadmCDNmidrepay")=""
session("canadmCDNdel")=""
session("canadmCDNoth")=""


if dsreg("canadmemailreapy")="y" then session("canadmemailreapy")="y"
if dsreg("canadmemaildel")="y" then session("canadmemaildel")="y"
if dsreg("canadmemailch")="y" then session("canadmemailch")="y"
if dsreg("canadmemailrenow")="y" then session("canadmemailrenow")="y"
if dsreg("canadmemailupdate")="y" then session("canadmemailupdate")="y"
if dsreg("canadmsqlrepay")="y" then session("canadmsqlrepay")="y"
if dsreg("canadmsqldel")="y" then session("canadmsqldel")="y"
if dsreg("canadmsqlpau")="y" then session("canadmsqlpau")="y"
if dsreg("canadmsqlch")="y" then session("canadmsqlch")="y"
if dsreg("canadmsqlrenow")="y" then session("canadmsqlrenow")="y"
if dsreg("canadmsqlupdate")="y" then session("canadmsqlupdate")="y"
if dsreg("canadmhostset")="y" then session("canadmhostset")="y"









if dsreg("canmodifyhtml")="y" then session("canmodifyhtml")="y"
if dsreg("cancheckmoney")="y" then session("cancheckmoney")="y"
if dsreg("canaddmoney")="y" then session("canaddmoney")="y"
if dsreg("candelmoney")="y" then session("candelmoney")="y"
if dsreg("cansetserver")="y" then session("cansetserver")="y"
if dsreg("canrebuild")="y" then session("canrebuild")="y"
if dsreg("canmodpass")="y" then session("canmodpass")="y"
if dsreg("canadmuser")="y" then session("canadmuser")="y"
if dsreg("canshowuser")="y" then session("canshowuser")="y"
if dsreg("canuserpass")="y" then session("canuserpass")="y"
if dsreg("candeluser")="y" then session("candeluser")="y"
if dsreg("canmailuser")="y" then session("canmailuser")="y"
if dsreg("canshowpro")="y" then session("canshowpro")="y"
if dsreg("cansetpro")="y" then session("cansetpro")="y"

if dsreg("canadmhost")="y" then session("canadmhost")="y"
if dsreg("canadmhostadd")="y" then session("canadmhostadd")="y"
if dsreg("canadmhostset")="y" then session("canadmhostset")="y"

if dsreg("canadmdomain")="y" then session("canadmdomain")="y"
if dsreg("candomainpay")="y" then session("candomainpay")="y"
if dsreg("candomaindel")="y" then session("candomaindel")="y"

if dsreg("canadmemail")="y" then session("canadmemail")="y"
if dsreg("canadmemailadd")="y" then session("canadmemailadd")="y"
if dsreg("canadmemailset")="y" then session("canadmemailset")="y"

if dsreg("canadmidc")="y" then session("canadmidc")="y"
if dsreg("canadmidcadd")="y" then session("canadmidcadd")="y"
if dsreg("canadmidcset")="y" then session("canadmidcset")="y"

if dsreg("canadmsql")="y" then session("canadmsql")="y"
if dsreg("canadmsqladd")="y" then session("canadmsqladd")="y"
if dsreg("canadmsqlset")="y" then session("canadmsqlset")="y"

if dsreg("cansetnews")="y" then session("cansetnews")="y"
if dsreg("canadmlog")="y" then session("canadmlog")="y"
if dsreg("canagnper")="y" then session("canagnper")="y"

if dsreg("canadmagn")="y" then session("canadmagn")="y"
if dsreg("canshowagn")="y" then session("canshowagn")="y"
if dsreg("canagnpass")="y" then session("canagnpass")="y"
if dsreg("cansetagn")="y" then session("cansetagn")="y"
if dsreg("cansuperuser")="y" then session("cansuperuser")="y"
if dsreg("canadmOther")="y" then session("canadmOther")="y"
if dsreg("cansysteminfo")="y" then session("cansysteminfo")="y"

if dsreg("canaws")="y" then session("canaws")="y"

if dsreg("canmoneyNew")="y" then session("canmoneyNew")="y"
if dsreg("canmoneyA")="y" then session("canmoneyA")="y"
if dsreg("canmoneyB")="y" then session("canmoneyB")="y"
if dsreg("canmoneyC")="y" then session("canmoneyC")="y"
if dsreg("canmoneyD")="y" then session("canmoneyD")="y"
if dsreg("canmoneyE")="y" then session("canmoneyE")="y"
if dsreg("canmoneyF")="y" then session("canmoneyF")="y"
if dsreg("canmoneyG")="y" then session("canmoneyG")="y"
if dsreg("canmoneyH")="y" then session("canmoneyH")="y"
if dsreg("canmoneyI")="y" then session("canmoneyI")="y"
if dsreg("canmoneyJ")="y" then session("canmoneyJ")="y"
if dsreg("canmoneyK")="y" then session("canmoneyK")="y"

if dsreg("canadmkefu")="y" then session("canadmkefu")="y"
if dsreg("canmodkefu")="y" then session("canmodkefu")="y"
if dsreg("candelkefu")="y" then session("candelkefu")="y"

if dsreg("canchnkefu")="y" then session("canchnkefu")="y"
if dsreg("onlypasusesite")="y" then session("onlypasusesite")="y"

if dsreg("canadmhostch")="y" then session("canadmhostch")="y"
if dsreg("canadmhostmidsub")="y" then session("canadmhostmidsub")="y"
if dsreg("canadmhostmiddomain")="y" then session("canadmhostmiddomain")="y"
if dsreg("canadmhostmidcpu")="y" then session("canadmhostmidcpu")="y"
if dsreg("canadmhostmidrepay")="y" then session("canadmhostmidrepay")="y"
if dsreg("canadmhostdel")="y" then session("canadmhostdel")="y"
if dsreg("canadmhostoth")="y" then session("canadmhostoth")="y"

if dsreg("canadmhostaddtest")="y" then session("canadmhostaddtest")="y"

if dsreg("canadmvps")="y" then session("canadmvps")="y"
if dsreg("canadmvpsadd")="y" then session("canadmvpsadd")="y"
if dsreg("canadmvpsaddtest")="y" then session("canadmvpsaddtest")="y"
if dsreg("canadmvpsset")="y" then session("canadmvpsset")="y"
if dsreg("canadmvpsch")="y" then session("canadmvpsch")="y"
if dsreg("canadmvpsmidrepay")="y" then session("canadmvpsmidrepay")="y"
if dsreg("canadmvpsdel")="y" then session("canadmvpsdel")="y"
if dsreg("canadmvpsoth")="y" then session("canadmvpsoth")="y"
if dsreg("canadmvpsmidcpu")="y" then session("canadmvpsmidcpu")="y"
if dsreg("canadmispbeian")="y" then session("canadmispbeian")="y"

if dsreg("canadmCDN")="y" then session("canadmCDN")="y"
if dsreg("canadmCDNadd")="y" then session("canadmCDNadd")="y"
if dsreg("canadmCDNaddtest")="y" then session("canadmCDNaddtest")="y"
if dsreg("canadmCDNset")="y" then session("canadmCDNset")="y"
if dsreg("canadmCDNch")="y" then session("canadmCDNch")="y"
if dsreg("canadmCDNmidrepay")="y" then session("canadmCDNmidrepay")="y"
if dsreg("canadmCDNdel")="y" then session("canadmCDNdel")="y"
if dsreg("canadmCDNoth")="y" then session("canadmCDNoth")="y"
if dsreg("canadmCDNmidcpu")="y" then session("canadmCDNmidcpu")="y"


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


	Set dshtml = Server.CreateObject("ADODB.Recordset")	
		Sql="Select id from FreeHost.FreeHost_HtmlStyle where username='freehost' and nowuse='1'"
		dshtml.Open Sql,conn,1,1
if dshtml.eof then
Response.Redirect "newhtmlstyle2.htm"
else
FreeHost_Loginlog session("admusername"),"管理员"
session("html1")=Application("html1")
session("html2")=Application("html2")
session("html3")=Application("html3")
session("html4")=Application("html4")
session("html5")=Application("html5")
session("html6")=Application("html6")
session("html7")=Application("html7")
session("html8")=Application("html8")
session("html9")=Application("html9")
session("html10")=Application("html10")
session("html11")=Application("html11")
session("html12")=Application("html12")
session("html13")=Application("html13")
session("html14")=Application("html14")
session("html15")=Application("html15")
session("html16")=Application("html16")
session("html17")=Application("html17")
session("html18")=Application("html18")
session("html19")=Application("html19")
session("html20")=Application("html20")
session("html21")=Application("html21")
session("html22")=Application("html22")
session("html23")=Application("html23")
session("html24")=Application("html24")
session("html25")=Application("html25")

session("html26")=Application("html26")
session("html27")=Application("html27")
session("html28")=Application("html28")
session("html29")=Application("html29")
session("html30")=Application("html30")
session("html31")=Application("html31")
session("html32")=Application("html32")

if isnull(Application("emailreg")) then Response.Redirect "emailcon.asp"
Response.Redirect "logininfo.asp"
end if
dsreg.close
set dsreg=nothing
end if

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