📄 admin_logon.asp
字号:
<!--#include file="admin_conn.asp"-->
<!--#include file="../include/md5.asp"-->
<!--#include file="../include/config.asp"-->
<!--#include file="../include/errmsg.asp"-->
<!--#include file="../include/ms_publicfunction.asp"-->
<!--#include file="admin_function.asp"-->
<%'==============================================================
'程序名称:茂盛网站管理系统(Maoin CSM)
'当前版本:Maosin CMS Version 1.1 Powered by maosin.com
'程序作者:阿茂(李胜茂)
'网站地址:www.maosin.com www.maosin.net
' QQ:57861417
'电子邮箱:maosin@163.com maosin@maosin.com
'--------------------------------------------------------------
'Copyright (C) 2006 maosin.com All Rights Reserved.
'免费版本请在程序首页保留(Powered by:Maosin CMS)版权链接信息;
'您可以对此版本进行修改,美化,但请保留此ASP文件内的版权信息;
'茂盛设计网保留此软件的法律追究权利
'==============================================================
%>
<?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>管理员登录</title>
<link href="images/admin.css" type=text/css rel=stylesheet>
<style>
td {
font-family:Verdana,Tahoma,"宋体";
font-size:10pt;
}
from{margin:0px;}
.logtable{border-top:5px outset #C1C1C1;font-size:10pt;border-left:5px outset #C1C1C1;font-size:10pt;border-right:5px outset #F7F7F7;font-size:10pt;border-bottom:5px outset #F7F7F7;font-size:10pt;}
.logtitle{background:#0096CE;border-bottom:3px solid #dddddd;filter:ALPHA(opacity=100,finishopacity=0,style=0,startx=0,starty=0,finishx=100,finishy=100);}
.logLimg{filter:ALPHA(opacity=80,finishopacity=0,style=1,startx=100,starty=100,finishx=0,finishy=0) blur(add=ture,direction=160,strength=2);}
.logButtom{background-color:#f8f8f8;border:1px outset #c2c2c2;}
.formTr{filter:ALPHA(opacity=80,finishopacity=0,style=1,startx=60,starty=0,finishx=100,finishy=0);}
</style>
</head>
<body bgcolor="#0096CE">
<table width="100%" height="100%"><tr><td align="center" valign="middle">
<%
if isAdminLogon=1 then
if session(userVar)<>userVal then
adminShowMsg "操作出错","你不是管理员,无权操行此操作!"
response.end()
end if
dim userInfo:userInfo=session("userInfo")
if cint(userInfo(2))<>3 then
adminShowMsg "操作出错","你不是管理员,无权操行此操作!"
response.end()
end if
end if
%>
<table width="500" border="0" cellpadding="0" cellspacing="0" align="center" class="logtable">
<tbody>
<tr>
<td height="30" colspan="2" valign="middle" class="logtitle"> <img src="images/ie_ico.gif" align="absmiddle"> <span style="height:14px;filter:shadow(Color=#5B5B5B,direction=135,strength=2);"><font color="#f2f2f2"><b><%=webname%>网站管理登录(MaoSin CMS Version 1.1)</b></font></span></td>
</tr>
<tr>
<td colspan="2" valign="middle" align="center" style="border-bottom:3px solid #dddddd;">
<img src="images/logon_top.jpg" border="0" style="filter:ALPHA(opacity=100,finishopacity=100,style=1,startx=90,starty=100,finishx=100,finishy=1);">
</td>
</tr>
<%if session(adminVar)=adminVal then%>
<tr width="100%" height="130" bgcolor="#FFFFFF" class="formTr">
<td width="300" align="center" valign="middle">
您已经成功登录啦,<a href="index.asp">进入管理……</a></td>
<td width="*" valign="middle" align="center"><img src="images/logon_ico.gif" class="logLimg"/></td>
</tr>
<%else
if Request.QueryString("action")="logon" then%>
<tr width="100%" height="130" bgcolor="#FFFFFF" class="formTr"><td width="370" valign="middle"><div style="height:100px;margin:5px;padding-top:4px;padding-left:4px;">
<%Call chklogon()%>
</div><div style="text-align:right;height:16px;"><input type="submit" name="Submit2" class="logButtom" value="返回上一步" onClick="javascript:window.history.go(-1);"/> <input type="submit" name="Submit3" class="logButtom" value="关闭窗口" onClick="javascript:window.close();"/></a></div></td>
<td width="*" valign="middle" align="center"><img src="images/logon_ico.gif" class="logLimg"/></td>
</tr>
<%else%>
<form action="admin_logon.asp?action=logon" name="loginform" method="post">
<tr width="100%" height="130" bgcolor="#FFFFFF" class="formTr">
<td width="300" align="center" valign="middle">
<div style="margin:5px;">管理账号:<input name="adminUser" id="adminUser" class="wenbenkang" type="text" size="20" />
</div>
<div style="margin:5px;">登录密码:<input name="adminPass" id="adminPass" class="wenbenkang" type="password" size="21" />
</div>
<div style="margin:5px;">验 证 码:<input type="text" name="getCode" class="wenbenkang" size="13" />
<img src="Admin_GetCode.asp" align="absmiddle" border="0" alt="看不清楚,请点击刷新!" onMouseOver="this.style.cursor='hand';" onClick="this.src='Admin_GetCode.asp';"/><br />
</div>
<div style="margin:5px;padding-top:4px;">
<input type="submit" name="Submit" class="logButtom" value="登录管理" />
<input type="button" name="Submit2" class="logButtom" value="返回首页" onClick="window.location.href='../index.asp';"/>
<input type="button" name="Submit3" class="logButtom" value="关闭窗口" onClick="javascript:window.close();"/>
</div>
</td>
<td width="*" valign="middle" align="center"><img src="images/logon_ico.gif" class="logLimg"/></td>
</tr>
</form>
<%
end if
end if%>
</tbody>
<tr>
<td height="60" colspan="2" valign="top" align="right" style="background-color:#eeeeee;border-top:3px solid #dddddd;">
<table width="100%" border="0"><tr><td align="center" width="180"><font color="#999999"><%=weburl%></font></td><td width="*"><hr width="100%" align="right" style="height:3px;border:1px groove #f7f7f7;" /></td></tr></table>版权所有© 2006-2008 <a href="<%=weburl%>" target="_blank"><%=webname%></a> <font color="#999999">Power By:<a href="http://www.maosin.com" target="_blank"><font color="#999999">MaoSin CMS</font></a></font>
</td>
</tr>
</tbody>
</table>
</td></tr></table>
</body>
</html>
<%
Sub chklogon()
dim adminUser,adminPass,getCode,errormsg
adminUser=trim(Request.form("adminUser"))
adminPass=trim(Request.form("adminPass"))
getCode=Request.form("getCode")
if chkIsOut=false then
showmsg "<font color=""#ff0000"">茂盛系统返回如下信息:</font><br><br>对不起,本站不允许从外部提交数据","系统出错信息"
exit sub
end if
if IsNumeric(getCode)=false then
response.write "验证码检验失败,请重新输入"
exit sub
else
if CInt(session("Admin_Code"))<>CInt(getCode) then
response.write "验证码检验失败,请重新输入"
exit sub
end if
end if
if chkIsAvaStr(adminUser)=false then
response.write "<font color=""#ff0000"">系统返回如下信息:</font><br><br>登录名含有非法字符"
exit sub
end if
if adminUser="" then
errormsg=errormsg&"<li>登录名不能为空,请返回重新输入!</li>"
end if
if adminPass="" then
errormsg=errormsg&"<li>密码不能为空,请返回重新输入!</li>"
end if
if errormsg<>"" then
response.write errormsg
exit sub
end if
errormsg=""
sql="select * from ms_admin where adminName='"&adminUser&"' and adminPass='"&md5(adminPass)&"'"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,connstr,1,3
if not rs.eof and not rs.bof then
if rs("adminPass")<>md5(adminPass) then
response.write "密码检验出错,登录密码不正确,请返回重新输入!"
rs.close
set rs=nothing
exit sub
end if
if rs("isLock")=1 then
response.write "登录出错,您的用户已经被锁定了!"
rs.close
set rs=nothing
exit sub
end if
rs("lastLogonTime")=now()
rs("lastLogonIp")=getIp()
rs("logonNum")=rs("logonNum")+1
rs.update
dim adminInfo(9)
session(adminVar)=adminVal
adminInfo(0)=rs("adminID")
adminInfo(1)=rs("adminName")
adminInfo(2)=rs("adminPass")
adminInfo(3)=rs("user_name")
adminInfo(4)=rs("adminStatus")
adminInfo(5)=rs("adminFlag")
adminInfo(6)=rs("lastLogonTime")
adminInfo(7)=rs("lastLogonIp")
adminInfo(8)=rs("user_id")
session(adminVar&"Info")=adminInfo
rs.close
set rs=nothing
conn.execute("insert into ms_adminlog(userName,scriptName,operateInfo,operateIp,operateTime) values('"&adminInfo(1)&"','"&getScriptName(0)&"','登录成功!','"&getIP()&"',#"&now()&"#)")
response.redirect "index.asp"
else
errormsg="登录失败,登录名或密码不正确!"
response.write errormsg
rs.close
set rs=nothing
conn.execute("insert into ms_adminlog(userName,scriptName,operateInfo,operateIp,operateTime) values('"&adminUser&"','"&getScriptName(0)&"','"&errormsg&"<br/>提交密码:"&chkformstr(adminPass)&"','"&getIP()&"',#"&now()&"#)")
exit sub
end if
End Sub
'========================================================
'MaoSin CMS 1.1 Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -