using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using xabaraCOM;

public partial class WebXabara_user_newPass : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        admin a = new admin();
        sqlServer sql = new sqlServer();
        javasrcipt js = new javasrcipt();

        a.check("|userPW|");

        string idTemp = xabara.isNum(Request["id"].Trim()).ToString();
        string strSql = "select * from XabaraUser where Uid=" + idTemp;
        string dimStr = "@UserPW";
        string[] strValue = new string[1];
        string strVlaueTemp = xabara.rnd("abc", 1) + xabara.rnd("abc123", 7);
        strValue[0] = xabara.md5(strVlaueTemp).ToString();

        if (sql.update("XabaraUser", dimStr, strValue, "Uid=" + idTemp).Equals("更新成功"))
        {
            sql.log(a.uid, "admin", "密码初始化");

            js.div(false, "新密码提示", "text", "新密码为：" + strVlaueTemp, 350, 0, "default.aspx?page=" + Request.QueryString["page"] + "&level=" + Request.QueryString["level"], "goto");
        }
        else
        {
            js.div(false, "", "text", "密码初始化失败！", 350, 0, "default.aspx?level=1", "goto");
        }
    }
}
