<%
dim pass0

if subaction = "post" then
	pass0 = Request("pass0")
	pass1 = Request("pass1")
	pass2 = Request("pass2")
	if pass1 = pass2 then
		sql = "SELECT pass FROM bg_adminUser WHERE id="& LOGINUSER
		set rs = conn.execute(sql)
		if rs("pass") = MD5(pass0) then
			sql = "UPDATE bg_adminUser SET pass='"& MD5(pass1) &"' WHERE id="& LOGINUSER
			conn.Execute(sql)
			DisplayMessage "您成功的修改了自己的口令！", false
		else
			DisplayMessage "旧口令输入错误！", false
		end if
	else
		DisplayMessage "您输入的新口令不正确！", false
	end if
else
%>
<br>
<br>
<table border="0" align="center" width="300" bordercolorlight="#CCE0CF" bordercolordark="#FFFFFF">
<form action="functions.asp" method="post">
<input type="hidden" name="action" value="<% =action %>">
<input type="hidden" name="subaction" value="post">
<input type="hidden" name="LOGINID" value="<%=LOGINID%>">
  <tr class="ListTableHeader">
    <td background="images/TableHeaderBg.gif" colspan="2" nowrap><b>修改自己的登录口令：</b></td>
  </tr>
  <tr class="InputTableRow">
    <td align="right" width="40%">旧登录口令：</td>
    <td width="60%"><input type="password" name="pass0" size="16" maxlength="16" class="ButtonEditPwd"></td>
  </tr>
  <tr class="InputTableRow">
    <td align="right">新登录口令：</td>
    <td><input type="password" name="pass1" size="16" maxlength="16" class="ButtonEditPwd"></td>
  </tr>
  <tr class="InputTableRow">
    <td align="right">新登录口令确认：</td>
    <td><input type="password" name="pass2" size="16" maxlength="16" class="ButtonEditPwd"></td>
  </tr>
  <tr class="MainPageBar" height="26">
    <td align="center" colspan="2"><input type="submit" value=" 确 定 " class="ButtonReply"> &nbsp; <input type="reset" value=" 清 除 " class="ButtonReply"></td>
  </tr>
</form>
</table>
<%
end if
%>
