<!--#Include File="Include.asp"--><%
'--------------------------------------
'Power By 580Web @2010-2014 f02
'URL:http://www.580Web.Cn/
'EMail:wsok85@qq.com
'QQ:253819801
'版权所有 未经允许不得去除本版权信息
'--------------------------------------

Call CheckAdminType("0,1",UType)

Dim Fk_Admin_LoginPass1,Fk_Admin_LoginPass2

Types=Clng(Request.QueryString("Type"))

Select Case Types
	Case 1
		Call PassWordEditForm() '修改密码表单
	Case 2
		Call PassWordEditDo() '执行修改密码
	Case Else
		Call FKFun.ShowErr("未发现功能项！",1)
End Select

'==========================================
'函 数 名：PassWordEditForm()
'作    用：修改密码表单
'==========================================
Sub PassWordEditForm()
%>
<form id="PassWordEdit" name="PassWordEdit" method="post" target="ajax" action="PassWord.asp?Type=2" showStr="密码修改成功！" boxClose="1">
<div id="title">修改管理员帐号</div>
<div id="box">
	<table width="90%" border="1" bordercolor="#CCCCCC" align="center" cellpadding="0" cellspacing="0">
		<tr>
			<td width="24%" height="30" align="right">登录名：</td>
			<td width="76%">&nbsp;<%=ULogin%></td>
		</tr>
		<tr>
			<td height="30" align="right">密码：</td>
			<td>&nbsp;<input name="Fk_Admin_LoginPass1" type="password" class="input" id="Fk_Admin_LoginPass1" /><span class="help" title="<p>管理用户密码，请输入0-50个字符。</p>"></span></td>
		</tr>
		<tr>
			<td height="30" align="right">重复密码：</td>
			<td>&nbsp;<input name="Fk_Admin_LoginPass2" type="password" class="input" id="Fk_Admin_LoginPass2" /><span class="help" title="<p>重新输入用户密码，两次密码需要一致，请输入0-50个字符。</p>"></span></td>
		</tr>
	</table>
</div>
<div id="bottom">
	<input type="hidden" name="Id" value="<%=Id%>" />
	<input type="submit" class="button" name="Enter" id="Enter" value="修 改" />
	<input type="button" onclick="dialogClose();" class="button" name="button" id="button" value="关 闭" />
</div>
</form>
<%
End Sub

'==============================
'函 数 名：PassWordEditDo
'作    用：执行修改密码
'==============================
Sub PassWordEditDo()
	Fk_Admin_LoginPass1=FKFun.HTMLEncode(Trim(Request.Form("Fk_Admin_LoginPass1")))
	Fk_Admin_LoginPass2=FKFun.HTMLEncode(Trim(Request.Form("Fk_Admin_LoginPass2")))
	Call FKFun.JsonString(Fk_Admin_LoginPass1,1,50,0,"请输入登录密码！","登录密码不能大于50个字符！")
	If Fk_Admin_LoginPass1<>Fk_Admin_LoginPass2 Then
		Call FKFun.JsonError("两次密码不一致！")
	End If
	Sqlstr="Select Fk_Admin_Id,Fk_Admin_LoginPass,Fk_Admin_State,Fk_Admin_Limit From [Fk_Admin] Where Fk_Admin_Id=" & UId
	Rs.Open Sqlstr,Conn,1,3
	If Not Rs.Eof Then
		Application.Lock()
		Rs("Fk_Admin_LoginPass")=Md5(Md5(Fk_Admin_LoginPass1,32),16)
		Rs.Update()
		Response.Cookies("p_f02")=Md5(Md5(Md5(Fk_Admin_LoginPass1,32),16)&"f02"&Request.ServerVariables("REMOTE_ADDR")&Date(),16)
		Application.UnLock()
		Call FKFun.JsonSuccess()
	Else
		Rs.Close
		Call FKFun.JsonError("要修改的管理员帐号不存在！")
	End If
	Rs.Close
End Sub

Call FKFun.PageEnd()
%>
