<!--#include file="tgzcm_Conn.asp"-->
<!--#include file="../tgzcm.Cache/tgzcm.Version.asp" -->
<!--#include file="../tgzcm.Include/tgzcm.Security.asp" -->
<!--include file="../tgzcm.Include/tgzcm.Funciton.asp" -->
<!--include file="../tgzcm.Include/tgzcm.Md5.asp"-->
<%
Action = Trim(Request("Action"))
SiteManageCode=tgzcm(3) '管理认证码
If Action = "Login" Then
    Call ChkLogin
ElseIf Action = "Logout" Then
    Call Logout
Else
    Call main
End If

Sub ChkLogin()
    Dim sql, rs
    Dim UserName, Password, CheckCode, RndPassword, AdminLoginCode
    UserName = ReplaceBadChar(Trim(Request("UserName")))
    Password = ReplaceBadChar(Trim(Request("Password")))
    CheckCode = LCase(ReplaceBadChar(Trim(Request("CheckCode"))))
    AdminLoginCode =Trim(tgzcm(3))' Trim(Request("AdminLoginCode"))

    If CSng(ScriptEngineMajorVersion & "." & ScriptEngineMinorVersion) < 5.6 Then
	    Call tgzcm_err_c("服务器脚本解释引擎（VBScript）版本过低，请联系您的空间商或服务器管理员更新。")
		Exit Sub
    End If

    If UserName = "" Then
		Call tgzcm_err_c("用户名不能为空！")
		Exit Sub
    End If
    If Password = "" Then
		Call tgzcm_err_c("密码不能为空！")
		Exit Sub
    End If
    If CheckCode = "" Then
		Call tgzcm_err_c("验证码不能为空！")
		Exit Sub
    End If
    If Trim(Session("CheckCode")) = "" Then
		Call tgzcm_err_c("你在管理登录停留的时间过长，导致验证码失效。请重新返回登录页面进行登录。")
		Exit Sub
    End If
    If CheckCode <> Session("CheckCode") Then
	    Call tgzcm_err_c("您输入的验证码和系统产生的不一致，请重新输入。")
		Exit Sub
    End If
    Password = MD5(Password, 16)
    Set rs = Server.CreateObject("adodb.recordset")
    sql = "select * from tgzcm_admin where admin_pass='" & Password & "' and admin_name='" & UserName & "'"
    rs.Open sql, Conn, 1, 3
    If rs.bof And rs.EOF Then
        FoundErr = True
        Call tgzcm_err_c("用户名或密码错误！！！")
    Else
        If Password <> rs("admin_pass") Then
            FoundErr = True
			Call tgzcm_err_c("用户名或密码错误！！！")
        End If
    End If
    If FoundErr = True Then
        'Call InsertLog(1, -1, UserName, UserTrueIP, "登录失败", ComeUrl, "")
        Session("AdminName") = ""
        Session("AdminPassword") = ""
        Session("RndPassword") = ""
        rs.Close
        Set rs = Nothing
        Exit Sub
    End If
    UserName = rs("admin_name")
    RndPassword = GetRndPassword(16)
    rs("LastLoginIP") = UserTrueIP '登录IP
	rs("LastLoginTime") = Now() '登录时间
	rs("RndPassword") = RndPassword '随机验证码
    rs.Update
    'Call InsertLog(1, 0, UserName, UserTrueIP, "登录成功", ComeUrl, "")

    strInstallDir = GetScriptPath(Trim(Request.ServerVariables("SCRIPT_NAME")), 1)
    Site_Sn = Replace(Replace(LCase(Request.ServerVariables("SERVER_NAME") & strInstallDir), "/", ""), ".", "")
    Response.Cookies(Site_Sn)("AdminName") = rs("admin_name")
    Response.Cookies(Site_Sn)("AdminPassword") = rs("admin_pass")
    Response.Cookies(Site_Sn)("RndPassword") = RndPassword
    Response.Cookies(Site_Sn)("AdminLoginCode") = AdminLoginCode
	Session("TgzcmCms")="tgzcm.com"
    rs.Close

    Call CloseConn
    Response.Redirect "tgzcm_index.asp"
End Sub

Sub Logout()
    strInstallDir = GetScriptPath(Trim(Request.ServerVariables("SCRIPT_NAME")), 1)
    Site_Sn = Replace(Replace(LCase(Request.ServerVariables("SERVER_NAME") & strInstallDir), "/", ""), ".", "")
    Response.Cookies(Site_Sn)("AdminName") = ""
    Response.Cookies(Site_Sn)("AdminPassword") = ""
	Session("TgzcmCms")=""
    Call CloseConn
	Call tgzcm_err_b("成功退出汇通网盘搜索引擎后台管理系统！！！","../index.asp")
End Sub
%>
<%Sub main%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理员登录</title>
<meta name="generator" content="tgzcmCms" />
<meta name="keywords" content="tgzcmCms,tgzcmCool,网站积分管理系统" />
<meta name="MSSmartTagsPreventParsing" content="TRUE" />
<meta http-equiv="MSThemeCompatible" content="Yes" />
<link rel="SHORTCUT ICON" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="skins/aspsky_1.css" />
<script language = "javaScript" src = "inc/Main.js" type="text/javascript"></script>
</head>
<body onLoad="if(window.name!=''){document.body.style.width='100%';}">
<div class="menuskin" id="popmenu" onMouseOver="clearhidemenu()" onMouseOut="dynamichide(event)" style="z-index:100;"></div><script language="javascript" type="text/javascript">var boardxml='',ISAPI_ReWrite = 0,forum_picurl='skins/Default/';</script><!--tgzcmCms管理后台CSS样式表--> 

<style type=text/css>

body {

	background:#CAD7F7; font-size: 12px; margin-top:0px;

	SCROLLBAR-FACE-COLOR: #799AE1; SCROLLBAR-HIGHLIGHT-COLOR: #799AE1; 

	SCROLLBAR-SHADOW-COLOR: #799AE1; SCROLLBAR-DARKSHADOW-COLOR: #799AE1; 

	SCROLLBAR-3DLIGHT-COLOR: #799AE1; SCROLLBAR-ARROW-COLOR: #FFFFFF;

	SCROLLBAR-TRACK-COLOR: #AABFEC;
	font-family:Verdana, Arial, Helvetica, sans-serif;

}

TD {

	FONT-SIZE: 12px

}

INPUT {

	BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 12px; BORDER-BOTTOM-WIDTH: 1px; BORDER-RIGHT-WIDTH: 1px

}

TEXTAREA {

	BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 12px; BORDER-BOTTOM-WIDTH: 1px; BORDER-RIGHT-WIDTH: 1px

}

SELECT {

	BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 12px; BORDER-BOTTOM-WIDTH: 1px; BORDER-RIGHT-WIDTH: 1px

}

SPAN {

	FONT-SIZE: 12px; POSITION: static

}

A {

	COLOR: #000000; TEXT-DECORATION: none

}

A:hover { color:#428EFF;text-decoration:underline; }

A.highlight {

	COLOR: red; TEXT-DECORATION: none

}

A.highlight:hover {

	COLOR: red

}

A.thisclass {

	FONT-WEIGHT: bold; TEXT-DECORATION: none

}

A.thisclass:hover {

	FONT-WEIGHT: bold

}

A.navlink {

	COLOR: #000000; TEXT-DECORATION: none

}

A.navlink:hover {

	COLOR: #003399; TEXT-DECORATION: none

}

.twidth {

	WIDTH: 760px

}

.content {

	FONT-SIZE: 14px; MARGIN: 5px 20px; LINE-HEIGHT: 140%; FONT-FAMILY: Tahoma,宋体

}

.aTitle {

	FONT-WEIGHT: bold; FONT-SIZE: 15px

}

TD.forumHeaderBackgroundAlternate {

	BACKGROUND-IMAGE: url(Admin/images/admin_top_bg.gif); COLOR: #000000; BACKGROUND-COLOR: #799ae1

}

#TableTitleLink A:link {

	COLOR: #ffffff; TEXT-DECORATION: none

}

#TableTitleLink A:visited {

	COLOR: #ffffff; TEXT-DECORATION: none

}

#TableTitleLink A:active {

	COLOR: #ffffff; TEXT-DECORATION: none

}

#TableTitleLink A:hover {

	COLOR: #ffffff; TEXT-DECORATION: underline

}

TD.forumRow {

	PADDING-RIGHT: 3px; PADDING-LEFT: 3px; BACKGROUND: #F1F3F5; PADDING-BOTTOM: 3px; PADDING-TOP: 3px

}

TH {

	FONT-WEIGHT: bold; FONT-SIZE: 12px; BACKGROUND-IMAGE: url(Admin/images/admin_bg_1.gif); COLOR: white; BACKGROUND-COLOR: #4455aa

}

TD.bodytitle {

	BACKGROUND-IMAGE: url(Admin/images/admin_bg_2.gif)

}

TD.bodytitle1 {

	BACKGROUND-IMAGE: url(Admin/images/admin_bg_3.gif)

}

TD.tablebody1 {

	PADDING-RIGHT: 3px; PADDING-LEFT: 3px; BACKGROUND: #bebbdb; PADDING-BOTTOM: 3px; PADDING-TOP: 3px

}

TD.forumRowHighlight {

	PADDING-RIGHT: 3px; PADDING-LEFT: 3px; BACKGROUND: #E4EDF9; PADDING-BOTTOM: 3px; PADDING-TOP: 3px

}

.tableBorder {

	BORDER-RIGHT: #183789 1px solid; BORDER-TOP: #183789 1px solid; BORDER-LEFT: #183789 1px solid; WIDTH: 98%; BORDER-BOTTOM: #183789 1px solid; BACKGROUND-COLOR: #ffffff

}

.tableBorder1 {WIDTH: 98%; }

.helplink {

	FONT: 10px verdana,arial,helvetica,sans-serif; CURSOR: help; TEXT-DECORATION: none

}

.copyright {

	PADDING-RIGHT: 1px; BORDER-TOP: #6595d6 1px dashed; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; FONT: 11px verdana,arial,helvetica,sans-serif; COLOR: #4455aa; PADDING-TOP: 1px; TEXT-DECORATION: none

}

.menuskin {

	BORDER: #666666 1px solid; VISIBILITY: hidden; FONT: 12px Verdana;

	POSITION: absolute; 

	BACKGROUND-COLOR:#EFEFEF;

	background-image:url("../skins/default/dvmenubg3.gif");

	background-repeat : repeat-y;

	}

.menuskin A {

	PADDING-RIGHT: 10px; PADDING-LEFT: 25px; COLOR: black; TEXT-DECORATION: none; behavior:url(inc/noline.htc);

	}

#mouseoverstyle {

	BACKGROUND-COLOR: #C9D5E7; margin:2px; padding:0px; border:#597DB5 1px solid;

	}

#mouseoverstyle A {

	COLOR: black

}

.menuitems{

	margin:2px;padding:1px;word-break:keep-all;

}

</style>
<style type="text/css">
body { background:#fff; background-image : url("skins/images/body_bg.gif");background-repeat: repeat-x ;  }
td { font-size:12px;}
input { border:1px solid #999; }
.button { color: #135294; border:1px solid #666; height:21px; line-height:18px; background:url("Admin/skins/images/button_bg.gif")}
div#nifty{margin: 0 10%;background: #ABD4EF;width: 420px;word-break:break-all; margin-top:60px;}
b.rtop, b.rbottom{display:block;background: #FFF}
b.rtop b, b.rbottom b{display:block;height: 1px;overflow: hidden; background: #ABD4EF}
b.r1{margin: 0 5px}
b.r2{margin: 0 3px}
b.r3{margin: 0 2px}
b.rtop b.r4, b.rbottom b.r4{margin: 0 1px;height: 2px}
</style>
<center>
<div id="nifty">
<b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b>
<div style="width:403px; height:26px; line-height:26px; background:none; font-size:12px; text-align:left;">&nbsp; 管理登录</div>
<div style="width:403px; height:46px; background:#166CA3;"><img src="skins/images/login.gif" alt="" width="403" height="46" /></div>
<div style="width:401px !important; width:403px; height:120px; background:#fff; border-left:1px solid #649EB2; border-right:1px solid #649EB2; "><BR>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<form name='Login' action='tgzcm_Login.asp?action=Login' method='post' target='_parent' onSubmit='return CheckForm();'>
	
	<tr>
		<td width="35%" align="right"><b>用户名：</b></td>
		<td><input name='UserName' type='text' id='UserName' maxlength='20' style="width:120px; height:20px; color:#006699" /></td>
	</tr>
	<tr>
		<td align="right"><b>密　码：</b></td>
		<td><input  name='password'  type='password' maxLength='20' style="width:120px; height:20px; color:#006699" /></td>
	</tr>
	<tr>
		<td align="right"><b>验证码：</b></td>
		<td><input name='CheckCode'  maxlength='6' type="text"style="width:120px; height:20px; color:#006699" />
		<img id='checkcode' src='../tgzcm.Include/tgzcm.Checkcode.asp' onClick="this.src='../tgzcm.Include/tgzcm.Checkcode.asp?'+Math.random();" style='border: 1px solid #ffffff;cursor:hand; ' /><span onClick="CheckCodeImg.src='../tgzcm.Include/tgzcm.Checkcode.asp?'+Math.random();" style="cursor:hand;" alt="看不清,我要换一个"></span>
      
        </td>
	</tr>
	<tr>
	<td height="38" align="right"></td>
	<td><input  class="button" type="Submit" name='Submit' value="登 录"/>
	  <input  class="button" type="reset" name="submit2" value="重 置"/></td>
	</tr>
  </form>
</table>
</div>
<div style="width:401px !important; width:403px; height:50px; background:#F7F7E7; border:1px solid #649EB2; border-top:1px solid #ddd; margin-bottom:5px; font-size:12px; line-height:20px; padding-top:13px; color:#649EB2; ">Copyright Right&copy;2012 www.tgzcm.com Version <%=veision%></div>
<b class="rbottom"><b class="r4"></b><b class="r3"></b><b class="r2"></b><b class="r1"></b>
</div>
<script language=javascript>
<!--
var closestr=0;
function SetFocus() {
if(document.Login.UserName.value == '')
  document.Login.UserName.focus();
else
  document.Login.UserName.select();
}
function CheckForm() {
  if(document.Login.UserName.value == '') {
    alert('请输入用户名！');
    document.Login.UserName.focus();
    return false;
  }
  if(document.Login.password.value == '') {
    alert('请输入密码！');
    document.Login.password.focus();
    return false;
  }
  if (document.Login.CheckCode.value == '') {
    alert ('请输入您的验证码！');
    document.Login.CheckCode.focus();
    return(false);
  }
}
function CheckBrowser() {
  var app=navigator.appName;
  var verStr=navigator.appVersion;
  if(app.indexOf('Netscape') != -1) {
    alert('友情提示：\n    你使用的是Netscape、Firefox或者其他非IE浏览器，可能会导致无法使用后台的部分功能。建议您使用 IE6.0 或以上版本。');
  } else if(app.indexOf('Microsoft') != -1) {
    if (verStr.indexOf('MSIE 3.0')!=-1 || verStr.indexOf('MSIE 4.0') != -1 || verStr.indexOf('MSIE 5.0') != -1 || verStr.indexOf('MSIE 5.1') != -1)
      alert('友情提示：\n    您的浏览器版本太低，可能会导致无法使用后台的部分功能。建议您使用 IE6.0 或以上版本。');
  }
}
function refreshimg(){document.all.checkcode.src='../tgzcm.Include/tgzcm.Checkcode.asp';}
//-->
</script>
<script language='JavaScript' type='text/JavaScript'>CheckBrowser();SetFocus();</script>
</body>
</html>
<%End Sub%>