Exemplo n.º 1
0
        public ApplicationContext(HttpContext oHttpContext)
        {
            m_oHttpContext = oHttpContext;

             var oSettings = new MemberProtectSettings(Settings.ConnectionString, m_oHttpContext.Session.SessionID, m_oHttpContext.Request.UserAgent,
                                                   m_oHttpContext.Request.UserHostAddress);
             m_oMemberProtect = new MemberProtect(oSettings);

             RequestContextHelper.Init(m_oMemberProtect);
        }
        public QuickbooksController()
        {
            var oSettings = new MemberProtectSettings(ConfigurationManager.ConnectionStrings["MemberProtectConnectionString"].ConnectionString);
             m_oMemberProtect = new MemberProtect(oSettings);

             m_sServiceInvoicePath = ConfigurationManager.AppSettings["ServiceInvoicePath"];
             m_sWebsiteInvoicePath = ConfigurationManager.AppSettings["WebsiteInvoicePath"];
             m_sInvoiceUrl = ConfigurationManager.AppSettings["InvoiceUrl"];
             m_sPaymentUrl = ConfigurationManager.AppSettings["PaymentUrl"];
        }
Exemplo n.º 3
0
        protected override void OnInit(EventArgs e)
        {
            MemberProtectSettings oSettings = new MemberProtectSettings(ConfigurationManager.ConnectionStrings["SpeedySpotsConnectionString"].ConnectionString, Session.SessionID);
            m_oMemberProtect = new MemberProtect(oSettings);

            if(BodyTag != null)
            {
                BodyTag.ID = System.IO.Path.GetFileNameWithoutExtension(HttpContext.Current.Request.FilePath);
            }

            base.OnInit(e);

            if(GetAccessControl() == AccessControl.Private)
            {
                // Ensure user has logged in
                if(!MemberProtect.CurrentUser.IsAuthorized)
                {
                    Response.Redirect("~/InetActive/login.aspx");
                    return;
                }

                // Ensure user is not locked out
                if(MemberProtect.CurrentUser.IsLocked)
                {
                    RedirectMessage("~/InetActive/login.aspx", "Your account has been locked.", MessageTone.Negative);
                    return;
                }
            }

            // Javascript Includes
            Page.ClientScript.RegisterClientScriptInclude("Common", Page.ResolveUrl("~/InetActive/scripts/common.js"));
        }