<!--#include file="../conn.asp"-->
<!-- #include file="../admin/check_master.asp" -->
<!--#include file="../inc/md5.asp" -->
<%
id=Request("id")
if session("qs")<>2 then
   offon=" disabled"
end if
   str="select * from ftbbs_admin where id="&id
   Set rs = Server.CreateObject("ADODB.Recordset")
   rs.open str,conn,1,1
if Request.Form("admin_pwd")<>"" then
   if rs("admin_pwd")=md5(request("old_admin_pwd")) or session("qs")=2 then
    if Request.Form("adminqs")="" then
       adminqs="0,0,0"
    else
       adminqs=Request.Form("adminqs")
    end if
	if session("qs")=2 then
       sql="update ftbbs_admin set admin_pwd='"&md5(Request.Form("admin_pwd"))&"',adminqs='"&adminqs&"' where id="&id
    else
	   sql="update ftbbs_admin set admin_pwd='"&md5(Request.Form("admin_pwd"))&"' where id="&id
	end if
	conn.Execute(sql)
	if session("admin_user")=Request.Form("mod_user") then
    session("admin_qs")=Request.Form("adminqs")
	session("admin_pwd")=md5(Request.Form("admin_pwd"))
	end if
    response.redirect "ftbbs_admin.asp"
   else
	response.write "<SCRIPT language=JavaScript>alert('对不起，你输入的旧密码是错误的，密码修改不成功！');"
   	response.write "history.go(-1);"
   	response.write "</script>"        
    response.end
   end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改管理用户</title>
<link href="../css/xmwuye.css" rel="stylesheet" type="text/css">
</head>

<body>
  <br>
  <br>
  <br>
  <br>
  <table width="71%" border="0" align="center">
  <form name="form1" method="post" action="">
    <tr bgcolor="f8f8f8"> 
      <td height="30" colspan="2"> <div align="center">修改密码</div></td>
    </tr>
    <tr bgcolor="f8f8f8"> 
      <td width="24%" height="30"> <div align="right">旧密码：</div></td>
      <td width="76%" height="30"> <input name="old_admin_pwd" type="text" size="26"></td>
    </tr>
    <tr bgcolor="f8f8f8"> 
      <td width="24%" height="30"> <div align="right">新密码：</div></td>
      <td width="76%" height="30"> <input name="admin_pwd" type="password" size="26"></td>
    </tr>
    <tr bgcolor="f8f8f8"> 
      <td height="30"> 
        <div align="right">操作权限：</div></td>
      <td height="30"><input name="adminqs" type="checkbox" id="adminqs" value="1" <%if instr(rs("adminqs"),1)>0 then%>checked<%end if%> <%=offon%>>
        添加 
        <input name="adminqs" type="checkbox" id="adminqs" value="2" <%if instr(rs("adminqs"),2)>0 then%>checked<%end if%> <%=offon%>>
        修改 
        <input name="adminqs" type="checkbox" id="adminqs" value="3" <%if instr(rs("adminqs"),3)>0 then%>checked<%end if%> <%=offon%>>
        删除</td>
    </tr>
    <tr bgcolor="f8f8f8"> 
      <td height="30">&nbsp;</td>
      <td height="30"><input type="submit" name="Submit" value="修改"> <input name="id" type="hidden" id="id" value="<%=request("id")%>">
        <input name="mod_user" type="hidden" id="mod_user" value="<%=request("mod_user")%>"></td>
    </tr>
	</form>
  </table>
</body>
</html>
