<!--#include file="../Inc/adminESCMS_conn.asp" -->
<!--#include file="../Inc/adminESCMS_config.asp" --><!--#include file="../Inc/ESCMS_md5.asp" -->

<%
Call DBConnBegin() 
Dim p_UserName,p_UserPass,p_VerifyCode,p_System,p_SqlLog,p_SqlLogin,p_Url,p_TempUserPass
p_UserName = Replace(Trim(Request.Form("Name")),"'","''")
p_TempUserPass = Replace(Trim(Request.Form("Password")),"'","''")

if IsSafeStr(p_UserName) = false or IsSafeStr(p_TempUserPass) = false then
	Response.Write("<script>alert(""错误：\n请正确添写您的用户名或密码"");location.href=""Admin_Login.asp"";</script>")
	Response.End
End if
if p_UserName = "" or  p_TempUserPass = "" then
	Response.Write("<script>alert(""错误：\n请填写完整"");location.href=""Admin_Login.asp"";</script>")
	Response.End
end if

if cstr(Session("GetCode"))<>cstr(Trim(Request("VerifyCode"))) then
	Response.Write("<script>alert(""错误：\n您输入的确认码和系统产生的不一致，请重新输入。\n返回后请刷新登录页面后重新输入正确的信息"");location.href=""Admin_Login.asp"";</script>")
	Response.End
end if

p_SqlLogin = "select * from wysystem where sys_user='"&p_UserName&"' and  sys_Pass='"&EnPas(md5(trim(p_TempUserPass)))&"'"

oRs.Open p_SqlLogin,oConn,1,1
if Not oRs.Eof then 
session("ES_admin")=oRs("sys_user")
session("ES_web_name")=oRs("web_name")
session("ES_web_host")=oRs("web_host")
Response.Redirect("es_index.html")
else
	Response.Write("<script>alert(""错误：\n用户名或密码错误，请重新输入"");location.href=""Admin_Login.asp"";</script>")
	Response.End
end if
Call DBConnend() 
%>