예제 #1
0
        public string SetPassword(string id, string pass)
        {
            string result = string.Empty;

            try
            {
                string enc_pass = CSecureUtil.Encrypt(pass);

                /**
                 * 여기에 ID와 패스워드를 이용하여 DB의 데이터 변경 작업을 한다.
                 *
                 * // 예시
                 * StringBuilder param = new StringBuilder();
                 * param.Append(id);
                 * param.Append(CConst.DB_PARAM_DELIMITER).Append(enc_pass);
                 *
                 * // DB작업
                 * //DataSet ds = WebSql.SelectSql(호출프로시저번호, param.ToString());
                 * DataSet ds = WebSql.SelectSql(3805, param.ToString());
                 *
                 *
                 *
                 */

                // XML로 결과값 리턴
                result = XmlUtil.GetSingleXml(enc_pass);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.ToString());
            }

            return(result);
        }
예제 #2
0
        public string Encrypt(string input)
        {
            string result = string.Empty;

            // XML로 결과값 리턴
            result = XmlUtil.GetSingleXml(CSecureUtil.Encrypt(input));

            return(result);
        }
예제 #3
0
파일: index.aspx.cs 프로젝트: whelper/DHNP
        /// <summary>
        /// 로그인
        /// </summary>
        private void GetLogin()
        {
            string password = string.Empty;

            if (CStringUtil.IsNullOrEmpty(admin_pw.Value) == false)
            {
                string password_enc = CSecureUtil.Encrypt(admin_pw.Value);

                //System.Diagnostics.Trace.WriteLine(password_enc);

                StringBuilder param = new StringBuilder();
                param.Append(admin_id.Value);
                param.Append(CConst.DB_PARAM_DELIMITER).Append(admin_pw.Value);
                param.Append(CConst.DB_PARAM_DELIMITER).Append(password_enc);

                SetDataList(3000, param.ToString());

                if (CStringUtil.IsNullOrEmpty(GetData(0, 0)) == false)
                {
                    // 로그인 설정 및 시작 메뉴 URL을 가져온다.
                    string startupUrl = SetLoginInfo();

                    if (CStringUtil.IsNullOrEmpty(startupUrl))
                    {
                        ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("접근 권한이 없습니다."));
                    }
                    else
                    {
                        Response.Redirect(startupUrl);
                    }
                }
                else
                {
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("아이디 또는 비밀번호가 다릅니다."));
                }
            }
            else
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("비밀번호가 입력되지 않았습니다."));
            }
        }
예제 #4
0
        /// <summary>
        /// 관리자 정보 수정
        /// </summary>
        private void ModifyAdminData()
        {
            string adminPwd = CSecureUtil.Encrypt(sys_insert_member_pwd.Value);

            StringBuilder param = new StringBuilder();

            param.Append(sys_insert_member_id.Value);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(sys_insert_member_nm.Value);
            param.Append(CConst.DB_PARAM_DELIMITER).Append(adminPwd);

            string[] result = ExecuteQueryResult(3803, param.ToString());

            if (result == null)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox("시스템 오류가 발생 했습니다."));
            }
            else if (result[0].Equals("00") == false)
            {
                // 수정 실패
                ClientScript.RegisterClientScriptBlock(this.GetType(), "test", CWebUtil.MsgBox(result[1]));
            }
        }