<!--#include file="Function.asp"-->
<%
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache" 
Response.AddHeader "Pragma", "No-Cache"
'-------------------清竹虚拟主机管理创建----------------------------
'本页面请勿手动修改任何信息，否则系统将出错无法正确运行，需要修改以下任何信息请使用被控端进行修改。
ActionPwd="B6A5C033B46D3403B61BB45278D1DD7F"  '动作密码
'--------------------------------------------------------------------
if IsEmpty(Application("em_MaxMPOP3")) and IsEmpty(Application("em_MaxSigns")) then
	dim mam
	set mam = server.createobject("easymail.AdminManager")

	tmp_num = 0
	do while tmp_num < 30
		mam.LoadExt

		if mam.IsLoadOK = true then
			Exit Do
		end if

		mam.Sleep 500
		tmp_num = tmp_num + 1
	loop
	if mam.IsLoadOK = true then
		Application("em_MaxMPOP3") = mam.MaxMPOP3
		Application("em_MaxSigns") = mam.MaxSigns
		Application("em_SystemAdmin") = LCase(mam.SystemAdmin)
		Application("em_EnableBBS") = mam.EnableBBS
		Application("em_Enable_SignHold") = mam.Enable_SignHold
		Application("em_Enable_FreeSign") = mam.Enable_FreeSign
		Application("em_Enable_SignWithDomainUser") = mam.Enable_SignWithDomainUser
		Application("em_Enable_SignNumberLimit") = mam.Enable_SignNumberLimit
		Application("em_SignNumberLimitDays") = mam.SignNumberLimitDays
		Application("em_Enable_ShareFolder") = mam.Enable_ShareFolder
		Application("em_Enable_SignEnglishName") = mam.Enable_SignEnglishName
		Application("em_LogPageKSize") = mam.LogPageKSize
		Application("em_TestAccounts") = LCase(mam.TestAccounts)
		Application("em_SignMode") = mam.SignMode
		Application("em_SignWaitDays") = mam.SignWaitDays
		Application("em_am_Name") = mam.am_Name
		Application("em_am_Accounts") = LCase(mam.am_Accounts)
		Application("em_AccountsAdmin") = LCase(mam.AccountsAdmin)
		Application("em_EnableEntAddress") = mam.Enable_Show_EntAddress

		Application("em_EnableTrap") = mam.EnableTrap
		if mam.EnableTrap = true then
			Application("em_TrapMail") = mam.TrapMail
		end if

		set mam = nothing
	else
		set mam = nothing
		response.redirect "outerr.asp?errstr=" & Server.URLEncode("超时, 请重试") & "&" & getGRSN()
	end if
end if
'------------------------------------------------------------------------------------------------------
Action=Request.QueryString("Action")
PassWord=Request.QueryString("PassWord")
ActCmd=Request.QueryString("ActCmd")
ActCmd=Split(ActCmd,"|")
Select Case Action
	Case "checkLink"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			Response.Write "ConnOk"
		End If
	Case "AddUserDomain"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>5 Then
				Response.Write "参数错误!"
			Else	
				BackV=AddUserDomain(ActCmd(0),ActCmd(1),ActCmd(2),ActCmd(3),ActCmd(4),ActCmd(5))
				Response.Write BackV
			End If
		End If
	Case "GetManageDomainInfo"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>0 Then
				Response.Write "参数错误!"
			Else	
				BackV=GetManageDomainInfo(ActCmd(0))
				Response.Write BackV
			End If
		End If
	Case "GetUserByDomain"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>0 Then
				Response.Write "参数错误!"
			Else	
				BackV=GetUserByDomain(ActCmd(0))
				Response.Write BackV
			End If
		End If
	Case "DomainUserCont"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>0 Then
				Response.Write "参数错误!"
			Else	
				BackV=DomainUserCont(ActCmd(0))
				Response.Write BackV
			End If
		End If
	Case "GetUserSize"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>0 Then
				Response.Write "参数错误!"
			Else	
				BackV=GetUserSize(ActCmd(0))
				Response.Write BackV
			End If
		End If
	Case "GetUserState"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>0 Then
				Response.Write "参数错误!"
			Else	
				BackV=GetUserState(ActCmd(0))
				Response.Write BackV
			End If
		End If
	Case "IsDomainAdmin"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>0 Then
				Response.Write "参数错误!"
			Else	
				BackV=IsDomainAdmin(ActCmd(0))
				Response.Write BackV
			End If
		End If
'-------------------清竹虚拟主机管理创建----------------------------
'页面验证封条，请勿修改，否则系统将无法正常运行
'-------------------------------------------------------------------
	Case "CheckIsUser"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>0 Then
				Response.Write "参数错误!"
			Else	
				BackV=CheckIsUser(ActCmd(0))
				Response.Write BackV
			End If
		End If
	Case "AddMailUser"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>3 Then
				Response.Write "参数错误!"
			Else	
				BackV=AddMailUser(ActCmd(0),ActCmd(1),ActCmd(2),ActCmd(3))
				Response.Write BackV
			End If
		End If
	Case "DelMailUser"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>0 Then
				Response.Write "参数错误!"
			Else	
				BackV=DelMailUser(ActCmd(0))
				Response.Write BackV
			End If
		End If
	Case "ChangeUserPass"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>1 Then
				Response.Write "参数错误!"
			Else	
				BackV=ChangeUserPass(ActCmd(0),ActCmd(1))
				Response.Write BackV
			End If
		End If
	Case "ChaSizeState"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>2 Then
				Response.Write "参数错误!"
			Else	
				BackV=ChaSizeState(ActCmd(0),ActCmd(1),ActCmd(2))
				Response.Write BackV
			End If
		End If
	Case "CheIsDomain"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>0 Then
				Response.Write "参数错误!"
			Else	
				BackV=CheIsDomain(ActCmd(0))
				Response.Write BackV
			End If
		End If
	Case "ChaDomainMxSize"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>1 Then
				Response.Write "参数错误!"
			Else	
				BackV=ChaDomainMxSize(ActCmd(0),ActCmd(1))
				Response.Write BackV
			End If
		End If
	Case "ChaDomainMxUser"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>1 Then
				Response.Write "参数错误!"
			Else	
				BackV=ChaDomainMxUser(ActCmd(0),ActCmd(1))
				Response.Write BackV
			End If
		End If
	Case "ChaDomainEndDate"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>1 Then
				Response.Write "参数错误!"
			Else	
				BackV=ChaDomainEndDate(ActCmd(0),ActCmd(1))
				Response.Write BackV
			End If
		End If
	Case "DelDomain"
		If PassWord<>ActionPwd Then
			Response.Write "ErrPwd"
		Else
			If UBound(ActCmd)<>0 Then
				Response.Write "参数错误!"
			Else	
				BackV=DelDomain(ActCmd(0))
				Response.Write BackV
			End If
		End If
End Select
'-------------------清竹虚拟主机管理创建----------------------------
'页面结束验证封条，请勿修改，否则系统将无法正常运行
'-------------------------------------------------------------------
%>