Example #1
0
    protected void iBtnInitPasswd_Click(object sender, ImageClickEventArgs e)
    {
        EmpInfos emp = new EmpInfos();

        string en_use_yn = WebUtility.GetConfig("ENCRYPTION_USE_YN").ToUpper();
        string encryption_oneway_mode = WebUtility.GetConfig("ENCRYPTION_ONEWAY_MODE").ToUpper();


        //bool isOK = emp.InitEmpPasswd(int.Parse(Request["empId"]), GetEncriptString(DEFAULT_PASS)); // 패스워드 암호화


        string encDEFAULT_PASS;

        if (en_use_yn.Equals("Y"))
        {
            encDEFAULT_PASS = FormsAuthentication.HashPasswordForStoringInConfigFile(DEFAULT_PASS, encryption_oneway_mode);
        }
        else
        {
            encDEFAULT_PASS = DEFAULT_PASS;
        }


        bool isOK = emp.InitEmpPasswd(Convert.ToInt32(empId), encDEFAULT_PASS);

        if (isOK)
        {
            Literal1.Text = JSHelper.GetAlertScript("패스워드를 초기화 하였습니다.", false);
        }
        else
        {
            Literal1.Text = JSHelper.GetAlertScript("패스워드를 초기화 하는데 실패하였습니다.", false);
        }
    }
Example #2
0
    private void ModifyPassword(int empId)
    {
        string sErr = "";

        if (!IsMandatory(out sErr, true))
        {
            PageUtility.ExecuteScript(string.Format("{0}", sErr));
            return;
        }



        string pw = "";

        if (EN_USE_YN.Equals("Y"))
        {
            //pw = GetEncriptString(txtPassword.Text.ToString());
            pw = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text.ToString(), ENCRYPTION_ONEWAY_MODE);
        }
        else
        {
            pw = txtPassword.Text.ToString();
        }

        EmpInfos emp  = new EmpInfos();
        bool     isOK = emp.InitEmpPasswd(empId, pw);

        if (isOK)
        {
            ltrScript.Text = JSHelper.GetAlertScript("비밀번호를 재설정 하였습니다.", true);
        }
        else
        {
            ltrScript.Text = JSHelper.GetAlertScript("비밀번호를 재설정 하는데 실패하였습니다.", false);
        }
    }