<%@ Page Language="C#" AutoEventWireup="true" Inherits="PowerEasy.Module.General.WebSite.Admin.ResetPassword" MasterPageFile="~/Admin/MasterPage.master" CodeBehind="ResetPassword.aspx.cs" ValidateRequest="false" Title="修改密码" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CphNavigation" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CphContent" runat="Server">
    <asp:ScriptManager ID="SmgeRegion" runat="server" EnablePartialRendering="true" />
    <table width="100%" border="0" cellpadding="2" cellspacing="1" class="border">
        <tr align="center">
            <td colspan="2" class="spacingtitle">
                <strong>修改密码</strong>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft" style="width: 50%" align="right">
                <strong>当前账号：</strong>
            </td>
            <td style="background-color: #d5e9ff;">
                <asp:TextBox ID="TextBoxName" runat="server" TextMode="SingleLine" ReadOnly="true" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft" style="width: 50%" align="right">
                <strong>原 密 码：</strong>
            </td>
            <td style="background-color: #d5e9ff;">
                <%-- 取消Type=Password，利用JS在页面加载完毕后修改 --%>
                <asp:TextBox ID="TxtOldPassword" runat="server"  AutoComplete="off"/>
                <pe:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="TxtOldPassword"
                    runat="server" ErrorMessage="原密码不能为空！" Display="Dynamic" />
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft" align="right">
                <strong>新 密 码：</strong>
            </td>
            <td style="background-color: #d5e9ff;">
                <%-- 取消Type=Password，利用JS在页面加载完毕后修改 --%>
                <asp:TextBox ID="TxtPassword" runat="server" AutoComplete="off" onblur="Bardisplaynone();" onfocus="Bardisplayshow();" />
                <pe:RequiredFieldValidator ID="ValrUserPassword" ControlToValidate="TxtPassword"
                    runat="server" ErrorMessage="新密码不能为空！" Display="Dynamic" />
                <asp:Label ID="LabTip" runat="server" />
                <span id="BarBorder_TxtUserPassword"></span>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft" align="right">
                <strong>确认密码：</strong>
            </td>
            <td style="background-color: #d5e9ff;">
                <%-- 取消Type=Password，利用JS在页面加载完毕后修改 --%>
                <asp:TextBox ID="TxtPassword2" runat="server" AutoComplete="off" />
                <asp:CompareValidator ID="CompareValidator1" ControlToValidate="TxtPassword2" ControlToCompare="TxtPassword"
                    ErrorMessage="两次输入的密码不一致！" runat="server" />
            </td>
        </tr>
        <tr class="tdbgbottom">
            <td colspan="2">
                <asp:Button ID="BtnSubmit" runat="server" Text="修改" OnClientClick="return BeginClick();" OnClick="BtnSubmit_Click" />
            </td>
        </tr>
    </table>
    <br />
    <div id="prompt-note">
        <dl>
            <dt class="prompt-note-tit">
                <span>提示说明</span>
            </dt>
            <dd class="prompt-note-con">
                <span style="color: Blue"><strong>注意：</strong></span>系统开启了强密码策略，请重新修改密码，密码要求如下：
                <div>1、长度不少于8位</div>
                <div>2、包含大写字母</div>
                <div>3、包含小写字母</div>
                <div>4、包含阿拉伯数字</div>
                <div>5、不能包含空格</div>
                <div>6、不能是容易猜到的常用密码如Admin888等</div>
            </dd>
        </dl>
    </div>

    <script type="text/javascript" src="../JS/Encrypt/BigInt.js"></script>
    <script type="text/javascript" src="../JS/Encrypt/Encrypt.js"></script>
    <script type="text/javascript" src="../JS/Encrypt/Barrett.js"></script>
    <script type="text/javascript" src="../JS/Encrypt/Common.js"></script>
    <script type="text/javascript">
        $(function () {
            var $useropass = $("#<%=TxtOldPassword.ClientID%>")[0];
            try {
                $useropass.type = 'password';
            } catch (e) {
                $useropass.outerHTML = $useropass.outerHTML.replace('type=text', '').replace('>', ' type="password">');
            }
            var $userpass = $("#<%=TxtPassword.ClientID%>")[0];
            try {
                $userpass.type = 'password';
            } catch (e) {
                $userpass.outerHTML = $userpass.outerHTML.replace('type=text', '').replace('>', ' type="password">');
            }
            var $usercpass = $("#<%=TxtPassword2.ClientID%>")[0];
            try {
                $usercpass.type = 'password';
            } catch (e) {
                $usercpass.outerHTML = $usercpass.outerHTML.replace('type=text', '').replace('>', ' type="password">');
            }
        });
        var BeginClick = function () {
            if (Page_ClientValidate()) {
                GetRsaEncrypt(4);
                $("#<%=TxtOldPassword.ClientID%>").val(rsaEncrypt($("#<%=TxtOldPassword.ClientID%>").val()));
                $("#<%=TxtPassword.ClientID%>").val(rsaEncrypt($("#<%=TxtPassword.ClientID%>").val()));
                $("#<%=TxtPassword2.ClientID%>").val(rsaEncrypt($("#<%=TxtPassword2.ClientID%>").val()));
                return true;
            } else {
                return false;
            }
        }
    </script>
</asp:Content>
