<%
'程序名称：千纸鹤网站管理系统
'程序作者：千纸鹤
'作者邮箱：qzhxxw@sina.com
'作者 Q Q：138999501
'作者电话：0000000000
'官方主页：http://www.qqzzhh.com/
'官方论坛：http://www.qqzzhh.com/bbs
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/set.asp"-->
<!--#include file="inc/dll.asp"-->
<!--#include file="inc/md5.asp"-->
<%
call hacker()
if session("superlogin")<>yecao then
response.Write "<script>alert('您还没有登陆！');this.location.href='index.asp';</script>"
Response.End
end if
if request.Form("edit")<>"" then
old_pass=MD5(trim(replace(request("old_pass"),"'","")))
admin_pass=MD5(trim(replace(request("admin_pass"),"'","")))
admin_pass_pass=MD5(trim(replace(request("admin_pass_pass"),"'","")))

if admin_pass<>admin_pass_pass then
Response.Write("<script>alert('密码和确认密码不同！请从新输入！');history.go(-1);</script>")
elseif old_pass=""  then
Response.Write("<script>alert('旧密码不能为空！');history.go(-1);</script>")
elseif admin_pass=""  then
Response.Write("<script>alert('新密码不能为空！');history.go(-1);</script>")
elseif admin_pass_pass=""  then
Response.Write("<script>alert('确认密码不能为空！');history.go(-1);</script>")
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from YC_admin where id="&request.Form("id")
rs.open sql,conn,1,3
if rs("admin_pass")<>old_pass then
Response.Write("<script>alert('旧密码错误！');history.back(1);</script>")
response.end
else
rs("admin_pass")=admin_pass
rs.update
rs.close
session("superlogin")=""
session("supername")=""
session("superuser")=""
session("superadmin")=""
Response.Write("<script>alert('修改成功！请重新登陆！');this.location.href='admin.asp';</script>")
end if
end if
%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="STYLESHEET" type="text/css" href="img/admin.css">
<script src=img/adminjs.js></script>
</head><br><br>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from YC_admin where admin_name='"&session("supername")&"'"
rs.open sql,conn,1,1%>
<script language="javascript">
function chk(){
if(document.form.admin_name.value==""){
alert("管理员名称不能为空！");
document.form.admin_name.focus();
return false;}
return true;}
</Script>
<form method="post" name="form" id="form" onsubmit="return chk();" action="?action=editadminok">
<table width="300" align=center border="0" cellpadding="0" cellspacing="0" rules=none class=3d>
<tr class="title"  height="22"><td><b>&nbsp;<img src=img/ie.gif border=0 width=15 height=15 align=absMiddle>&nbsp;修改密码</b></td></tr>	
<tr class=bg height="25"><td>
&nbsp;管理员名称：&nbsp;<B style="color:red"><%=rs("admin_name")%></B>
</td></tr>
<tr class=bg height="25"><td>
&nbsp;输入旧密码：<input name="old_pass" type="password" id="old_pass"  class=yecao style="width:150px">

</td></tr>
<tr class=bg height="25"><td>
&nbsp;输入新密码：<input name="admin_pass" type="password" id="admin_pass"  class=yecao style="width:150px">
</td></tr>
<tr class=bg height="25"><td>
&nbsp;确认新密码：<input name="admin_pass_pass" type="password" id="admin_pass_pass"  class=yecao style="width:150px">
</td></tr>
<tr><td class="hr"></td></tr>
<tr height="30" class=foot>
<td align="center">
<input name="edit" type="submit" class="adminbutton" id="edit" value="修 改">&nbsp;
<input name="Submit2" type="reset" class="adminbutton" value="清 空" >
<input name="id" type="hidden"  value="<%=rs("id")%>" >
</td></tr>
</table></form>
<%call closedata()%>














