Пример #1
0
        protected static string GetUserName(HttpRequest request)
        {
            string strUserName = "";

            strUserName = PH_Utility.GetCookie(request, ConfigurationManager.AppSettings["PH_NameUserCookie"]);
            return(strUserName == "" ? strUserName : PH_EncrptHelper.MD5Decryp(strUserName));
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Session["s_forceChange"] as string))
            {
                if (HttpContext.Current.Request.Url.AbsolutePath.Substring(HttpContext.Current.Request.Url.AbsolutePath.Length - 19, 19) != "changepassword.aspx")
                {
                    Response.Redirect(Session["s_forceChange"].ToString(), false);
                }
            }
            if (!IsPostBack)
            {
                //lnkChangePasswd.HRef = "changepassword.aspx?" + Request.QueryString;
                //lnkDayofExpired.HRef = "dayofexpired.aspx?" + Request.QueryString;

                if (PH_Utility.GetCookie(Request, ConfigurationManager.AppSettings["PH_NameUserCookie"]) == "" && PH_Utility.GetCookie(Request, ConfigurationManager.AppSettings["PH_RoleUserCookie"]) == "")
                {
                    Response.Redirect("login.aspx", false);
                }
                //else if (Request["id"] == null) Response.Redirect("logout.aspx", false);
                else
                {
                    eStatus = new PHCore_Status();
                    string strRoleId = PH_EncrptHelper.MD5Decryp(PH_Utility.GetCookie(Request, ConfigurationManager.AppSettings["PH_RoleUserCookie"]));
                    if (strRoleId != "")
                    {
                        eStatus.RoleId = (PHCore_Status.RoleID)Enum.Parse(typeof(PHCore_Status.RoleID), strRoleId, true);
                    }

                    GenMenu();
                }
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //lnkChangePasswd.HRef = "changepassword.aspx?" + Request.QueryString;
                //lnkDayofExpired.HRef = "dayofexpired.aspx?" + Request.QueryString;

                if (PH_Utility.GetCookie(Request, ConfigurationManager.AppSettings["PH_NameUserCookie"]) == "" && PH_Utility.GetCookie(Request, ConfigurationManager.AppSettings["PH_RoleUserCookie"]) == "")
                {
                    Response.Redirect("login.aspx", false);
                }
                else if (Request["id"] == null)
                {
                    Response.Redirect("logout.aspx", false);
                }
                else
                {
                    eStatus = new PHCore_Status();
                    string strRoleId = PH_EncrptHelper.MD5Decryp(PH_Utility.GetCookie(Request, ConfigurationManager.AppSettings["PH_RoleUserCookie"]));
                    if (strRoleId != "")
                    {
                        eStatus.RoleId = (PHCore_Status.RoleID)Enum.Parse(typeof(PHCore_Status.RoleID), strRoleId, true);
                    }

                    GenMenu();
                }
            }
        }