<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" %>

<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="PowerEasy.Module.General.Model.UserManage" %>
<%@ Import Namespace="PowerEasy.Module.General.BusinessLogic.UserManage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>密码修复工具</title>

    <script runat="server" type="text/C#">
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                List<AdministratorInfo> AdministratorInfoList = Administrators.GetAdminLists();
                foreach (AdministratorInfo AdminInfo in AdministratorInfoList)
                {
                    AdminInfo.Hash = Administrators.GetAuthenticatePassHash(AdminInfo.AdminPassword);
                    Administrators.Update(AdminInfo);
                }
            }
            catch(Exception ex)
            {
                Response.Write(ex.Message.ToString());
                return;
            }
            Response.Write("<li>管理员用户信息修复成功!</li>");
        }
    </script>

</head>
</html>
