<%@ Page Language="c#" Inherits="Web.Wpdcc.adminPassword" CodeBehind="adminPassword.aspx.cs" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>管理员密码设置</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file="../Css/adminCssEdit.htm"-->
    <script language="javascript" type="text/javascript" src="../js/pwdintensity.js"></script>

    <script language="javascript" type="text/javascript">				
	$(document).ready(function(){

        //保存前验证（改用统一验证js）
        $("#ok").click(function() {
            if (checkAllValidate())
            {   
                return CheckPassword();                               
            }else{
                return false;
            }
                        
        });       
            
    });
    
    //检查密码安全等级，由onkeyup触发
    var rank = 100;
	function changePwdRank(o) {
	    if (o) {	    
		    rank = PwdIntensity(o.value);
		    printIntensity(rank);		
	    }
    }
	
	function CheckPassword(){

	    if (rank < <%= Common.Config.adminStrongPassword %>)
	    {
            alert("新密码过于简单,请重新设置!");
            return false;
        }        
        else
        {
            //检查新密码二次输入一致性
            var pwd1 = $("#password").val().trim();
            var pwd2 = $("#validatePassword").val().trim();
            if ( pwd1 == pwd2  )
            { 
                return true;
            }else{
                alert("新密码两次输入不一致！");
                return false;
            }
        }
	}
	
	
    </script>
    
</head>
<body>
    <div class="edit-func-box func-box">
        <div class="hd b">
            管理员信息</div>
        <form id="Form1" method="post" runat="server">
        <div class="bd">
            <table id="Table1" class="edit-table">
                <tr>
                    <th width="25%">
                        管理员帐号：
                    </th>
                    <td width="75%">
                        <asp:TextBox ID="adminName" runat="server" CssClass="input-txt" notNull="true" msgName="管理员帐号" ></asp:TextBox> 
                        <asp:CheckBox ID="CheckBox1" runat="server" Text="修改帐号" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                <th>
                管理员名称：
                </th>
                <td>
                <asp:TextBox ID="fullName" runat="server" CssClass="input-txt" notnull="true" msgname="管理员名称"></asp:TextBox>
                </td>
                </tr>
                <tr id="troldpwd" runat="server">
                    <th>
                        旧密码：
                    </th>
                    <td>
                        <asp:TextBox ID="oldPassword" class="input-txt1 input-txt" runat="server" TextMode="Password"
                            notNull="true" msgName="旧密码"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <th>
                        新密码：
                    </th>
                    <td>
                        <asp:TextBox ID="password" class="input-txt1 input-txt" runat="server" TextMode="Password"
                            notNull="true" MaxLength="20" msgName="新密码" onkeyup="changePwdRank(this);" Style="float: left"></asp:TextBox>
                        <span id="PasswordCheck" style="float: left; display: none; background-position: 0px 0px;
                            background-image: url(images/password_check_bk.gif); width: 215px; background-repeat: no-repeat;
                            height: 15px; overflow: hidden"></span>
                    </td>
                </tr>
                <tr>
                    <th>
                        确认新密码：
                    </th>
                    <td>
                        <asp:TextBox ID="validatePassword" class="input-txt1 input-txt" runat="server" TextMode="Password"
                            notNull="true" MaxLength="20" msgName="确认新密码"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </div>
        <div class="ft">
            <div class="action-field txt-c">
                <asp:CheckBox ID="synchronizationASP" runat="server" Text="同步ASP管理员密码"></asp:CheckBox>&nbsp;&nbsp;
                <asp:Button ID="ok" class="btn" runat="server" Text="确定" OnClick="ok_Click"></asp:Button>&nbsp;&nbsp;
                <input type="button" class="btn" value="关 闭" onclick="parent.$.fancybox.close();" />&nbsp;&nbsp;<asp:Label ID="labMassage" runat="server" Text="" ForeColor="Red" Visible="false"></asp:Label>
            </div>
            <!--/action-field-->
        </div>
        </form>
</body>
</html>
