Example #1
0
    private void SetResultGrid()
    {
        string sDeptID = string.Empty;
        string sUserNM = string.Empty;
        string sSDT    = string.Empty;
        string sEDT    = string.Empty;

        sDeptID = txtDeptID.Text + "%";
        sUserNM = txtUserNM.Text + "%";
        if (wdcSDate.Value != null)
        {
            sSDT = wdcSDate.Text.ToString().Replace("-", "");
            sEDT = Convert.ToDateTime(wdcEDate.Text).AddDays(1).ToShortDateString().Replace("-", "");
        }
        else
        {
            sSDT = "20000101";
            sEDT = "99990101";
            //sSDT = DateTime.Now.ToShortDateString().Replace("-", "");
            //sEDT = DateTime.Now.AddDays(1).ToShortDateString().Replace("-", "");
        }


        MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common Biz = new MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common();

        int iTotalRows = Biz.GetConnectLogCount(sDeptID, sUserNM, sSDT, sEDT);
        int iLastPage  = (int)Math.Ceiling((Double)iTotalRows / ugrdResultStatus.DisplayLayout.Pager.PageSize);
        int iFirstRow  = (ugrdResultStatus.DisplayLayout.Pager.CurrentPageIndex - 1) * ugrdResultStatus.DisplayLayout.Pager.PageSize;
        int iLastRow   = ugrdResultStatus.DisplayLayout.Pager.CurrentPageIndex * ugrdResultStatus.DisplayLayout.Pager.PageSize;


        ViewState.Add("CurrentPageIndex", ugrdResultStatus.DisplayLayout.Pager.CurrentPageIndex);
        ViewState.Add("PageCount", iLastPage);


        DataTable dt = Biz.GetConnectLog(sDeptID, sUserNM, sSDT, sEDT, iFirstRow + 1, iLastRow);

        ugrdResultStatus.Clear();
        ugrdResultStatus.DataSource = dt;
        ugrdResultStatus.DataBind();

        //DataRow[] row = dt.Select(" SEQ < 3 AND  ");

        //DataTypeUtility.FilterSortDataTable(dt,"");

        //DataTypeUtility.GetBoolean ("");



        lblRowCount.Text = iTotalRows.ToString();
    }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Context.User.Identity.IsAuthenticated)
        {
            SiteIdentity gUserInfo = (SiteIdentity)Context.User.Identity;
            MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common Biz = new MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common();
            Biz.ModifyConnectLog(Session.SessionID, gUserInfo.LoginID);
        }

        FormsAuthentication.SignOut();

        string login_page_url = WebUtility.GetConfig("Login_Page_Url", "~/base/Login.aspx");

        Response.Redirect(login_page_url);
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MicroBSC.RolesBasedAthentication.SitePrincipal newUser = null;

        int    login_status = LOGIN_STATUS;
        string user_id      = USER_ID;

        string login_page_url = WebUtility.GetConfig("Login_Page_Url", "~/base/Login.aspx");

        //int login_status = 3;
        //string user_id = "admin";

        if (login_status > 0 && !user_id.Equals("-1"))
        {
            LOGIN_STATUS = -4;
            USER_ID      = string.Empty;


            MicroBSC.Biz.Common.EmpInfos emp = new MicroBSC.Biz.Common.EmpInfos();
            int emp_ref_id = emp.ValidateLogin(user_id);

            if (emp_ref_id.Equals(0))
            {
                FormsAuthentication.SignOut();
                Response.Redirect(login_page_url);
                return;
            }

            newUser = new MicroBSC.RolesBasedAthentication.SitePrincipal(user_id);

            Context.User = newUser;

            MicroBSC.RolesBasedAthentication.SiteIdentity gUserInfo = (MicroBSC.RolesBasedAthentication.SiteIdentity)Context.User.Identity;

            MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common objCtlCommon = new MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common();
            objCtlCommon.AddConnectLog(Session.SessionID, gUserInfo.Emp_Ref_ID, gUserInfo.LoginID, gUserInfo.Emp_Name, Request.UserHostAddress, "BSC");

            FormsAuthentication.RedirectFromLoginPage(user_id, false);
            Response.Redirect("~/base/Main.aspx");
        }
        else
        {
            FormsAuthentication.SignOut();
            Response.Redirect(login_page_url);
        }
    }
Example #4
0
    private void DoAction(int LOGIN_STATUS, string USER_ID)
    {
        //페이지 열릴대마다 로그 기록
        writeLog(string.Format("{0} : DoAction() START", Request.PhysicalPath));

        MicroBSC.RolesBasedAthentication.SitePrincipal newUser = null;

        int    login_status = LOGIN_STATUS;
        string user_id      = USER_ID;

        string login_page_url = WebUtility.GetConfig("Login_Page_Url", "~/base/Login.aspx");

        if (WebUtility.GetConfig("SSL", "N").Equals("Y"))
        {
            if (WebUtility.GetConfig("SSLLIVE", "N").Equals("Y"))
            {
                login_page_url = WebUtility.GetConfig("SSL.LoginPageLive", "~/base/Login.aspx");
            }
            else
            {
                login_page_url = WebUtility.GetConfig("SSL.LoginPage", "~/base/Login.aspx");
            }
        }
        //int login_status = 3;
        //string user_id = "admin";

        if (login_status > 0 && !user_id.Equals("-1"))
        {
            LOGIN_STATUS = -4;
            USER_ID      = string.Empty;


            MicroBSC.Biz.Common.EmpInfos emp = new MicroBSC.Biz.Common.EmpInfos();
            int emp_ref_id = emp.ValidateLogin(user_id);

            if (emp_ref_id.Equals(0))
            {
                FormsAuthentication.SignOut();
                Response.Redirect(login_page_url);
                return;
            }

            newUser = new MicroBSC.RolesBasedAthentication.SitePrincipal(user_id);

            Context.User = newUser;

            MicroBSC.RolesBasedAthentication.SiteIdentity gUserInfo = (MicroBSC.RolesBasedAthentication.SiteIdentity)Context.User.Identity;


            if (WebUtility.GetConfig("LOG_SIGNON", "N").Equals("Y"))
            {
                MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common objCtlCommon = new MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common();
                objCtlCommon.AddConnectLog(Session.SessionID, gUserInfo.Emp_Ref_ID, gUserInfo.LoginID, gUserInfo.Emp_Name, Request.UserHostAddress, "BSC");
            }

            //페이지 열릴대마다 로그 기록
            writeLog(string.Format("{0} : DoAction() END", Request.PhysicalPath));

            FormsAuthentication.RedirectFromLoginPage(user_id, false);
            Response.Redirect("~/base/Main.aspx");
        }
        else
        {
            //페이지 열릴대마다 로그 기록
            writeLog(string.Format("{0} : DoAction() END", Request.PhysicalPath));
            FormsAuthentication.SignOut();
            Response.Redirect(login_page_url);
        }
    }
Example #5
0
    protected void loginbtn_Click(object sender, ImageClickEventArgs e)
    {
        string        bscAuth    = ConfigurationManager.AppSettings["BSC.Authentication"].ToString();
        string        domainName = ConfigurationManager.AppSettings["Domain.Name"].ToString();
        SitePrincipal newUser    = null;

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

        string encPasswd;

        if (en_use_yn.Equals("Y"))
        {
            encPasswd = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPasswd.Text, encryption_oneway_mode);
        }
        else
        {
            encPasswd = txtPasswd.Text;
        }

        if (bscAuth.Equals("Forms")) // 폼 인증
        {
            newUser = SitePrincipal.ValidateLogin(txtLoginID.Text, encPasswd);
        }
        else if (bscAuth.Equals("Windows")) // 윈도우 인증 & 폼인증
        {
            if (WindowAuthentication.ValidateLogin(txtLoginID.Text, encPasswd, domainName, Context))
            {
                newUser = new SitePrincipal(txtLoginID.Text);
            }
        }

        if (newUser == null)
        {
            MicroBSC.Integration.COM.Biz.Biz_Com_Emp_Info bizEmpInfo = new MicroBSC.Integration.COM.Biz.Biz_Com_Emp_Info();
            string emp_ref_id = bizEmpInfo.Get_Emp_Ref_Id(txtLoginID.Text);

            if (emp_ref_id.Length == 0)
            {
                //ID가 없음
                this.ltrScript.Text = JSHelper.GetAlertScript("ID가 존재하지 않습니다.");
                txtLoginID.Focus();
            }
            else
            {
                //비번이 틀림
                this.ltrScript.Text = JSHelper.GetAlertScript("비밀번호가 틀렸습니다.");
                txtPasswd.Focus();
            }
        }
        else
        {
            Context.User = newUser;

            SaveUserID(txtLoginID.Text, true);                  // 쿠키 저장 여부
            //login.SetUserLogs(txtUserID.Text, Request.ServerVariables["REMOTE_ADDR"].ToString(), Request.ServerVariables["HTTP_USER_AGENT"].ToString(), Session.SessionID);



            SiteIdentity gUserInfo = (SiteIdentity)Context.User.Identity;



            //MicroBSC.Integration.CTL.Dac.Dac_Ctl_Common log = new MicroBSC.Integration.CTL.Dac.Dac_Ctl_Common();
            //log.InsertConnectLog(Session.SessionID, gUserInfo.Emp_Ref_ID, gUserInfo.LoginID, gUserInfo.Emp_Name, Request.UserHostAddress, "BSC");



            MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common objCtlCommon = new MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common();
            objCtlCommon.AddConnectLog(Session.SessionID, gUserInfo.Emp_Ref_ID, gUserInfo.LoginID, gUserInfo.Emp_Name, Request.UserHostAddress, "BSC");



            FormsAuthentication.RedirectFromLoginPage(txtLoginID.Text, false);
            Response.Redirect("Main.aspx");

            //if (Request["ReturnUrl"] != null)
            //{
            //    //Response.Cookies["GSBNPortalWeb"].Expires = DateTime.Today.AddDays(-1);
            //    //Response.Cookies["GSBNPortalWeb"].Value = null;

            //    FormsAuthentication.RedirectFromLoginPage(txtLoginID.Text, false);
            //    Response.Redirect("../index.aspx?" + "ReturnUrl=" + Request["ReturnUrl"]);
            //}
            //else
            //{
            //    FormsAuthentication.RedirectFromLoginPage(txtLoginID.Text, false);
            //}
        }
    }
Example #6
0
    protected void loginbtn_Click(object sender, ImageClickEventArgs e)
    {
        //세션ID 업데이트
        Session.Abandon();
        Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));

        string        bscAuth    = ConfigurationManager.AppSettings["BSC.Authentication"].ToString();
        string        domainName = ConfigurationManager.AppSettings["Domain.Name"].ToString();
        SitePrincipal newUser    = null;

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

        string encPasswd;

        if (en_use_yn.Equals("Y"))
        {
            encPasswd = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPasswd.Text, encryption_oneway_mode);
        }
        else
        {
            encPasswd = txtPasswd.Text;
        }

        int loginResult       = 0;
        int max_login_failcnt = DataTypeUtility.GetToInt32(WebUtility.GetConfig("MAX_LOGIN_FAILCNT", "5"));

        if (bscAuth.Equals("Forms")) // 폼 인증
        {
            //newUser = SitePrincipal.ValidateLogin(txtLoginID.Text, encPasswd);
            loginResult = SitePrincipal.ValidateLogin(txtLoginID.Text, encPasswd, max_login_failcnt, out newUser); //로그인 시도 허용횟수 검사
        }
        else if (bscAuth.Equals("Windows"))                                                                        // 윈도우 인증 & 폼인증
        {
            if (WindowAuthentication.ValidateLogin(txtLoginID.Text, encPasswd, domainName, Context))
            {
                newUser = new SitePrincipal(txtLoginID.Text);
            }
        }

        if (newUser == null)
        {
            //MicroBSC.Integration.COM.Biz.Biz_Com_Emp_Info bizEmpInfo = new MicroBSC.Integration.COM.Biz.Biz_Com_Emp_Info();
            //string emp_ref_id = bizEmpInfo.Get_Emp_Ref_Id(txtLoginID.Text);
            //if (emp_ref_id.Length == 0)
            //{
            //    //ID가 없음
            //    this.ltrScript.Text = JSHelper.GetAlertScript("ID가 존재하지 않습니다.");
            //    txtLoginID.Focus();
            //}
            //else
            //{
            //    //비번이 틀림
            //    this.ltrScript.Text = JSHelper.GetAlertScript("비밀번호가 틀렸습니다.");
            //    txtPasswd.Focus();
            //}
            if (loginResult == 0)
            {
                this.ltrScript.Text = JSHelper.GetAlertScript("ID 또는 비밀번호가 틀렸습니다.");
                txtPasswd.Focus();
            }
            else if (loginResult == -1)
            {
                this.ltrScript.Text = JSHelper.GetAlertScript("로그인 시도 횟수가 초과되었습니다. 관리자에게 문의하세요.");
                txtPasswd.Focus();
            }
            else
            {
                this.ltrScript.Text = JSHelper.GetAlertScript("관리자에게 문의하세요.");
                txtPasswd.Focus();
            }
        }
        else
        {
            Context.User = newUser;

            SaveUserID(txtLoginID.Text, true);                  // 쿠키 저장 여부
            //login.SetUserLogs(txtUserID.Text, Request.ServerVariables["REMOTE_ADDR"].ToString(), Request.ServerVariables["HTTP_USER_AGENT"].ToString(), Session.SessionID);



            SiteIdentity gUserInfo = (SiteIdentity)Context.User.Identity;



            //MicroBSC.Integration.CTL.Dac.Dac_Ctl_Common log = new MicroBSC.Integration.CTL.Dac.Dac_Ctl_Common();
            //log.InsertConnectLog(Session.SessionID, gUserInfo.Emp_Ref_ID, gUserInfo.LoginID, gUserInfo.Emp_Name, Request.UserHostAddress, "BSC");


            if (WebUtility.GetConfig("LOG_SIGNON", "N").Equals("Y"))
            {
                MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common objCtlCommon = new MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common();
                objCtlCommon.AddConnectLog(Session.SessionID, gUserInfo.Emp_Ref_ID, gUserInfo.LoginID, gUserInfo.Emp_Name, Request.UserHostAddress, "BSC");
            }


            if (WebUtility.GetConfig("SSL", "N").Equals("N"))
            {
                FormsAuthentication.RedirectFromLoginPage(txtLoginID.Text, false);
                Response.Redirect("Main.aspx");
            }
            else
            {
                if (WebUtility.GetConfig("SSLLIVE", "N").Equals("Y"))
                {
                    FormsAuthentication.RedirectFromLoginPage(txtLoginID.Text, false);
                    Response.Redirect(WebUtility.GetConfig("SSL.MainPageLive", "Main.aspx"));
                }
                else
                {
                    FormsAuthentication.RedirectFromLoginPage(txtLoginID.Text, false);
                    Response.Redirect(WebUtility.GetConfig("SSL.MainPage", "Main.aspx"));
                }
            }


            //if (Request["ReturnUrl"] != null)
            //{
            //    //Response.Cookies["GSBNPortalWeb"].Expires = DateTime.Today.AddDays(-1);
            //    //Response.Cookies["GSBNPortalWeb"].Value = null;

            //    FormsAuthentication.RedirectFromLoginPage(txtLoginID.Text, false);
            //    Response.Redirect("../index.aspx?" + "ReturnUrl=" + Request["ReturnUrl"]);
            //}
            //else
            //{
            //    FormsAuthentication.RedirectFromLoginPage(txtLoginID.Text, false);
            //}
        }
    }
Example #7
0
    protected void iBtnAdd_Click(object sender, ImageClickEventArgs e)
    {
        Biz_MenuInfo objMenuInfo = new Biz_MenuInfo();

        DataTable dataTable = objMenuInfo.GetDataTableSchema();

        dataTable = UltraGridUtility.GetDataTableByCheckValue(this.UltraWebGrid1
                                                              , "cBox"
                                                              , "selchk"
                                                              , new string[] { "MENU_REF_ID", "UP_MENU_ID", "MENU_NAME", "MENU_DIR", "MENU_PAGE_NAME", "MENU_PARAM", "MENU_FULL_PATH"
                                                                               , "MENU_DESC", "MENU_PRIORITY", "MENU_AUTH_TYPE", "MENU_TYPE", "MENU_NAME_IMAGE_PATH", "MENU_NAME_IMAGE_PATH_U"
                                                                               , "MENU_PREV_ICON_PATH", "MENU_CREATE_DATE", "SHOW_LEFT_MENU" }
                                                              , dataTable);

        MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common bizCustom = new MicroBSC.Integration.CTL.Biz.Biz_Ctl_Common();

        int okCnt = bizCustom.AddMenuRole(dataTable, ddlRoles.SelectedValue);

        //RoleInfos role = new RoleInfos();

        //role.RemoveRoleMenu();

        //role.AddRoleMenu(int.Parse(ddlRoles.SelectedValue), int.Parse(hdfMenu_Ref_ID.Value));
        //WebCommon.SetRoleDropDownList(ddlRoles, int.Parse(hdfMenu_Ref_ID.Value));
        //DataBindingMenuRole(int.Parse(hdfMenu_Ref_ID.Value));
        CheckMenuRoleCount();
        GridBindginMenu();

        //Biz_MenuInfo objMenuInfo = new Biz_MenuInfo();

        //DataTable blankDataTable = new DataTable();
        //blankDataTable.Columns.Add("ROLE_REF_ID", typeof(string));
        //blankDataTable.Columns.Add("MENU_REF_ID", typeof(string));

        ////dataTable = UltraGridUtility.GetDataTableByCheckValue(this.UltraWebGrid1
        ////                                                    , "cBox"
        ////                                                    , "selchk"
        ////                                                    , new string[] { "MENU_REF_ID", "UP_MENU_ID", "MENU_NAME", "MENU_DIR", "MENU_PAGE_NAME", "MENU_PARAM", "MENU_FULL_PATH"
        ////                                                    , "MENU_DESC", "MENU_PRIORITY", "MENU_AUTH_TYPE", "MENU_TYPE", "MENU_NAME_IMAGE_PATH", "MENU_NAME_IMAGE_PATH_U"
        ////                                                    , "MENU_PREV_ICON_PATH", "MENU_CREATE_DATE", "SHOW_LEFT_MENU","MENU_ROLE" }
        ////                                                    , dataTable);

        //foreach (UltraGridRow ugRow in UltraWebGrid1.Rows)
        //{
        //    TemplatedColumn col_cBox = (TemplatedColumn)ugRow.Band.Columns.FromKey("selchk");
        //    CheckBox cBox = (CheckBox)((CellItem)col_cBox.CellItems[ugRow.BandIndex]).FindControl("cBox");

        //    if (cBox.Checked)
        //    {
        //        DataRow dataRow = blankDataTable.NewRow();

        //        TemplatedColumn col_ddl = (TemplatedColumn)ugRow.Band.Columns.FromKey("MENU_ROLE");
        //        DropDownList colDDL = (DropDownList)((CellItem)col_ddl.CellItems[ugRow.BandIndex]).FindControl("ddlMenuRole");

        //        dataRow["ROLE_REF_ID"] = colDDL.SelectedValue;

        //        dataRow["MENU_REF_ID"] = ugRow.Cells.FromKey("MENU_REF_ID").Value;


        //        blankDataTable.Rows.Add(dataRow);
        //    }

        //}

        //object a = this.UltraWebGrid1.Rows[1].Cells.FromKey("MENU_ROLE").Value;

        //Biz_DongbuMetal_Custom bizCustom = new Biz_DongbuMetal_Custom();

        //int okCnt = bizCustom.AddMenuRole(blankDataTable, ddlRoles.SelectedValue);

        ////RoleInfos role = new RoleInfos();

        ////role.RemoveRoleMenu();

        ////role.AddRoleMenu(int.Parse(ddlRoles.SelectedValue), int.Parse(hdfMenu_Ref_ID.Value));
        ////WebCommon.SetRoleDropDownList(ddlRoles, int.Parse(hdfMenu_Ref_ID.Value));
        ////DataBindingMenuRole(int.Parse(hdfMenu_Ref_ID.Value));
        //CheckMenuRoleCount();
    }