<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/sz.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_sz_STRING
Recordset1.Source = "SELECT * FROM tAdmin"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("Aadmin"))
If MM_valUsername <> "" Then
  MM_fldUserAuthorization=""
  MM_redirectLoginSuccess="admin.asp"
  MM_redirectLoginFailed="login.asp"
  MM_flag="ADODB.Recordset"
  set MM_rsUser = Server.CreateObject(MM_flag)
  MM_rsUser.ActiveConnection = MM_sz_STRING
  MM_rsUser.Source = "SELECT fAdmin, fPassword"
  If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
  MM_rsUser.Source = MM_rsUser.Source & " FROM tAdmin WHERE fAdmin='" & Replace(MM_valUsername,"'","''") &"' AND fPassword='" & Replace(Request.Form("Apassword"),"'","''") & "'"
  MM_rsUser.CursorType = 0
  MM_rsUser.CursorLocation = 2
  MM_rsUser.LockType = 3
  MM_rsUser.Open
  If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then 
    ' username and password match - this is a valid user
    Session("MM_Username") = MM_valUsername
    If (MM_fldUserAuthorization <> "") Then
      Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
    Else
      Session("MM_UserAuthorization") = ""
    End If
    if CStr(Request.QueryString("accessdenied")) <> "" And false Then
      MM_redirectLoginSuccess = Request.QueryString("accessdenied")
    End If
    MM_rsUser.Close
    Response.Redirect(MM_redirectLoginSuccess)
  End If
  MM_rsUser.Close
  Response.Redirect(MM_redirectLoginFailed)
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>

</head>

<body>
<table border="0" cellspacing="0" cellpadding="0" align="center" class="t9">
  <tr>
    <td align="center"><img src="images/title.gif" width="307" height="65"></td>
  </tr>
</table>
<p>&nbsp;</p>
<table width="85%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td><form ACTION="<%=MM_LoginAction%>" method="POST" >
        <table width="69%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#C8E3FF" class="t9">
          <tr align="center">
            <td colspan="2" height="50"><font color="#FF0000">管理员登录区域，无关人员请勿进入！</font></td>
          </tr>
          <tr>
            <td width="30%" align="right" height="35">用户：</td>
            <td width="75%" height="35"><input type="text" name="Aadmin">
            </td>
          </tr>
          <tr>
            <td width="30%" align="right" height="35">密码：</td>
            <td width="75%" height="35"><input type="password" name="Apassword">
            </td>
          </tr>
          <tr>
            <td width="30%" align="right" height="35">&nbsp;</td>
            <td width="75%" height="35"><input type="submit" name="Submit" value="确定">
                <input type="reset" name="Submit2" value="重填">
            </td>
          </tr>
        </table>
    </form></td>
  </tr>
</table>

</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
