<!--#include file="../conn.asp" -->
<%
if session("admin")="" then
Response.Write("<script language=JavaScript>alert('对不起,您没有权限使用该功能!!');history.back();</script>")
response.end
end if%>
<%
a=Request("a")
if a="epass" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from setting"
rs.open sql,conn,1,3
if rs("adminpass")=request.form("oldpass") then
rs("adminname")=request.form("adminuser")
rs("adminpass")=request.form("newpass")
rs.update
response.write("<script>alert('管理员密码修改成功！');location.href='admin_syspassword.asp';</script>")
else
response.write("<script>alert('原密码输入错误，请重试！');history.back(-1);</script>")
end if
rs.close
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from setting"
rs.open sql,conn,1,1
%>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<link href="/diary/style.css" rel="stylesheet" type="text/css">
</head>
<script language="JavaScript">
function CheckForm()
{
    if (document.form1.adminuser.value.length <2 || document.form1.sitename.value.length >16) {
    		alert("管理员账号必须为2-16");
		document.form1.sitename.focus();
		return false;
	}
	    if (document.form1.oldpass.value.length <4 || document.form1.oldpass.value.length >16) {
    		alert("原密码位数为4-16位");
		document.form1.oldpass.focus();
		return false;
	}
	
	    if (document.form1.newpass.value.length 40 || document.form1.newpass.value.length >16) {
    		alert("新密码位数为4-16位");
		document.form1.newpass.focus();
		return false;
	}
return true;
}
</script>
<body  style="OVERFLOW:hidden;OVERFLOW-X:HIDDEN;OVERFLOW-y:hidden;background-color=transparent" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<form language="javascript"  name="form1" method="post" action="?a=epass" onSubmit="return CheckForm()">
  <table width="100%" border="1" cellpadding="0" cellspacing="0"  bordercolor="#d7f5ff" bordercolordark="#FFFFFF" id="table1" bordercolorlight="#cccccc">
    <tr> 
      <td align="center" height="34" background="images/center_title_bg.jpg"><font color="#00ACF0" size="4"><b>管理员密码修改</b></font></td>
    </tr>
    <tr> 
      <td align="center" nowrap height="150">管理员: 
        <input name="adminuser" type="text"  size="20" maxlength="16" value="<%=rs("adminname")%>"><br>
		原密码: 
        <input name="oldpass" type="text"  size="20" maxlength="16"><br>
		新密码: 
        <input name="newpass" type="text"  size="20" maxlength="16">
        <br><input type="submit" name="Submit0" value="提交">
      </td>
    </tr>
    <tr> 
      <td align="center" height="34" background="images/center_title_bg.jpg"> 
        <div align="center"></div>
        <div align="center"></div>
      </td>
    </tr>
  </table>
 </form> 
</body>

</html>
<%
rs.close
%>
