示例#1
0
        public void OnAuthenticateRequest(Object source, EventArgs e)
        {
            HttpApplication app     = (HttpApplication)source;
            HttpContext     context = app.Context;

            _enabled = false;

            // Check whether we are enabled in configuration
            _config = WebConfigurationManager.GetSection(
                FormsAuthConfigurationSection.ConfigurationSectionName,
                context.Request.Path
                ) as FormsAuthConfigurationSection;
            if (_config == null || !_config.Enabled)
            {
                return;
            }

            // Check whether we are enabled at runtime
            if (!IsFormsAuthEnabled(context))
            {
                return;
            }

            _enabled = true;

            // Invoke the underlying module
            _onEnter.Invoke(_module, new Object[] { source, e });
        }
        public void OnAuthenticateRequest(Object source, EventArgs e)
        {
            HttpApplication app = (HttpApplication)source;
            HttpContext context = app.Context;

            _enabled = false;

            // Check whether we are enabled in configuration
            _config = WebConfigurationManager.GetSection(
                        FormsAuthConfigurationSection.ConfigurationSectionName,
                        context.Request.Path
                      ) as FormsAuthConfigurationSection;
            if (_config == null || !_config.Enabled)
            {
                return;
            }

            // Check whether we are enabled at runtime
            if (!IsFormsAuthEnabled(context))
            {
                return;
            }

            _enabled = true;

            // Invoke the underlying module
            _onEnter.Invoke(_module, new Object[] {source, e});
        }