📄 admin_admin.asp
字号:
<!--#include file = admin_chk.asp -->
<head>
<STYLE type="text/css">
<!--
a:link {text-decoration: none; font-family: AdobeSm; color: #000000 }
a:visited {text-decoration: none; color: #000000 }
A:hover {COLOR: green; FONT-FAMILY: "宋体,MingLiU"; TEXT-DECORATION: underline}
body {font-size: 9pt; font-family: 宋体,MingLiU, Arial;color: #000000}
TD {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000;line-height: 120%;table-layout:fixed;word-break:break-all}
p {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
input {FONT-SIZE: 9pt; FONT-FAMILY: "宋体,MingLiU, Arial";color: #000000}
body {margin-top: 0; margin-bottom: 0;margin-left:0;margin-right:0; color: #000000}
select {FONT-SIZE: 9PT;font-family: 宋体}
option {FONT-SIZE: 9pt;font-family: 宋体}
textarea {FONT-SIZE: 9pt;font-family: 宋体}
-->
</STYLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<!--#include file = admin_conn.asp -->
<!--#include file = titleb.asp -->
<!--#include file = md5.asp -->
<%
username=chkhtm(trim(request("username")))
oldpassword=chkhtm(trim(request("oldpassword")))
password1=trim(request("password1"))
password2=trim(request("password2"))
ID=trim(request("ID"))
if (not isNumeric(ID)) then
id=""
end if
if username<>"" and id<>"" and oldpassword<>"" and password1<>"" and password2<>"" then
if password1<>password2 then
Response.Write "<script>alert('2次新密码不一样,请返回重输。');</script> <meta http-equiv='refresh' content='0; url=javascript:window.history.go(-1);'>"
Response.end
end if
password1=md5(password1)
oldpassword=md5(oldpassword)
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [admin] where [ID]="&ID&" and [pass]='"&oldpassword&"' order by id desc",conn,3,3
if rs.recordcount=0 then
Response.Write "<script>alert('旧密码输入不正确。');</script> <meta http-equiv='refresh' content='0; url=javascript:window.history.go(-1);'>"
Response.end
else
rs("user")=username
rs("pass")=password1
Response.Cookies ("adminuser")=username
Response.Cookies ("adminpass")=password1
Response.Cookies ("admindj")=rs("dj")
rs.update
Response.Write "<script>alert('新密码修改成功!');</script> <META http-equiv='refresh' CONTENT='0;url=?'>"
Response.end
end if
rs.close:set rs=nothing
end if
sql = "select * from [admin] where [user]='"&session("admin__user")&"'"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
%>
<div align="center">
<p> </p>
<table border="1" width="500" id="table1" cellpadding="3" style="border-collapse: collapse" bordercolor="#C0C0C0" cellspacing="0">
<tr>
<td width="473" background="../images/topBar_bg.gif">
<font face="Wingdings"> </font><b>修改用户名和密码</b></td>
</tr>
<tr>
<td><br>
<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.username.value == "")
{
alert("请在 用户名 域中输入值。");
theForm.username.focus();
return (false);
}
if (theForm.username.value.length < 2)
{
alert("在 用户名 域中,请至少输入 2 个字符。");
theForm.username.focus();
return (false);
}
if (theForm.username.value.length > 20)
{
alert("在 用户名 域中,请最多输入 20 个字符。");
theForm.username.focus();
return (false);
}
if (theForm.oldpassword.value == "")
{
alert("请在 旧密码 域中输入值。");
theForm.oldpassword.focus();
return (false);
}
if (theForm.oldpassword.value.length < 4)
{
alert("在 旧密码 域中,请至少输入 4 个字符。");
theForm.oldpassword.focus();
return (false);
}
if (theForm.oldpassword.value.length > 20)
{
alert("在 旧密码 域中,请最多输入 20 个字符。");
theForm.oldpassword.focus();
return (false);
}
if (theForm.password1.value == "")
{
alert("请在 新密码 域中输入值。");
theForm.password1.focus();
return (false);
}
if (theForm.password1.value.length < 5)
{
alert("在 新密码 域中,请至少输入 5 个字符。");
theForm.password1.focus();
return (false);
}
if (theForm.password1.value.length > 20)
{
alert("在 新密码 域中,请最多输入 20 个字符。");
theForm.password1.focus();
return (false);
}
if (theForm.password2.value == "")
{
alert("请在 确认新密码 域中输入值。");
theForm.password2.focus();
return (false);
}
if (theForm.password2.value.length < 5)
{
alert("在 确认新密码 域中,请至少输入 5 个字符。");
theForm.password2.focus();
return (false);
}
if (theForm.password2.value.length > 20)
{
alert("在 确认新密码 域中,请最多输入 20 个字符。");
theForm.password2.focus();
return (false);
}
return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="?id=<%=rs("id")%>" name="FrontPage_Form1" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript">
<table border="0" width="100%" id="table2" cellspacing="0" cellpadding="5">
<tr>
<td width="152" align="center">用户</td>
<td>
<!--webbot bot="Validation" s-display-name="用户名" b-value-required="TRUE" i-minimum-length="2" i-maximum-length="20" --><input type="text" name="username" size="38" maxlength="20" value="<%=rs("user")%>" <%if Request.Cookies("admindj")<>1 then response.write "readonly"%>></td>
</tr>
<tr>
<td width="152" align="center">旧密码</td>
<td>
<!--webbot bot="Validation" s-display-name="旧密码" b-value-required="TRUE" i-minimum-length="4" i-maximum-length="20" --><input type="password" name="oldpassword" size="38" maxlength="20"></td>
</tr>
<tr>
<td width="152" align="center">新密码</td>
<td>
<!--webbot bot="Validation" s-display-name="新密码" b-value-required="TRUE" i-minimum-length="5" i-maximum-length="20" --><input type="password" name="password1" size="38" maxlength="20"></td>
</tr>
<tr>
<td width="152" align="center">确认新密码</td>
<td>
<!--webbot bot="Validation" s-display-name="确认新密码" b-value-required="TRUE" i-minimum-length="5" i-maximum-length="20" --><input type="password" name="password2" size="38" maxlength="20"></td>
</tr>
</table>
<p align="center"><input type="submit" value="提交" name="B1"> <input type="reset" value="重置" name="B2"></p>
</form>
</td>
</tr>
</table>
</div>
<% if Request.Cookies("admindj")=1 then %>
<p align="center"> </p>
<div align="center">
<table border="1" width="600" id="table3" style="border-collapse: collapse" bordercolor="#C0C0C0" cellspacing="0" cellpadding="3">
<tr>
<td colspan="3" background="../images/topBar_bg.gif"><font face="Wingdings">
1</font><b>所有管理员 </b>(<a href="admin_admin_add.asp">增加录入人员</a>) (<a href="admin_admin_sh_add.asp">增加审核员</a>) (<a href="admin_stat_user.asp">查看用户文章排名</a>)</td>
</tr>
<%
sql = "select * from admin "
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
while not rs.eof
%>
<tr>
<td width="199"><%=rs("user")%>
<%
Set rs4 = Server.CreateObject("ADODB.RecordSet")
rs4.Open "select * from [news] where adduser='"&rs("user")&"' order by id desc",conn,1,1
Response.Write "("&rs4.recordcount&"篇)"
if rs("dj")="3" then Response.Write "<font color=red>[录入员]</font>"
if rs("dj")="2" then Response.Write "<font color=blue>[审核员]</font>"
%>
</td>
<td width="264" align=center>
<%
lmid=rs("lmid")&","
nr=split(lmid,",")
'Response.Write ubound(nr)
For i=0 to ubound(nr)
aaa=nr(i)
if aaa="" then aaa=0
sql3 = "select * from lm where id="&aaa
Set rs3 = Server.CreateObject("ADODB.RecordSet")
rs3.Open sql3,conn,1,1
if rs3.recordcount<>0 then
Response.Write rs3("lm")&rs3("lm2")&rs3("lm3")&","
end if
rs3.close
set rs3=nothing
next
%>
</td>
<td width="106" align=center>
<%if rs("dj")<>1 then%>
<a href="admin_admin_edit.asp?id=<%=rs("id")%>">栏目</a> <a href="admin_admin_editpass.asp?id=<%=rs("id")%>">密码</a> <a href="admin_admin_del.asp?id=<%=rs("id")%>">删除</a>
<%end if%></td>
</tr>
<%
rs.movenext
wend
%>
</table>
</div>
<% end if %>
<%
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -