mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 01:41:17 -10:00
* System.Web/HttpApplication.cs: added new state to handle default authentication. * System.Web.Configuration/HttpModulesConfigurationHandler.cs: add a default authentication module at the end of the list. * System.Web.Configuration/ModuleItem.cs: new constructor. * System.Web.Security/DefaultAuthenticationModule.cs: implemented. It just create a default unauthenticated user when no one else provided one. * System.Web.Security/FormsAuthenticationModule.cs: removed debug output. * System.Web.UI/Control.cs: (AddedControl): take the children to the same state of the parent. (InitRecursive): set the page of the children. * System.Web.UI/Page.cs: removed one line (it's done a few lines above). * System.Web.UI/UserControl.cs: (OnInit): always call InitializeAsUserControl (InitializeAsUserControl): sets the page for the control. svn path=/trunk/mcs/; revision=10114
44 lines
1016 B
C#
44 lines
1016 B
C#
//
|
|
// System.Web.Security.DefaultAuthenticationModule
|
|
//
|
|
// Authors:
|
|
// Gonzalo Paniagua Javier ([email protected])
|
|
//
|
|
// (C) 2002 Ximian, Inc (http://www.ximian.com)
|
|
//
|
|
|
|
using System.Web;
|
|
using System.Security.Principal;
|
|
|
|
namespace System.Web.Security
|
|
{
|
|
public sealed class DefaultAuthenticationModule : IHttpModule
|
|
{
|
|
static GenericIdentity defaultIdentity = new GenericIdentity ("", "");
|
|
|
|
public event DefaultAuthenticationEventHandler Authenticate;
|
|
|
|
public void Dispose ()
|
|
{
|
|
}
|
|
|
|
public void Init (HttpApplication app)
|
|
{
|
|
app.DefaultAuthentication += new EventHandler (OnDefaultAuthentication);
|
|
}
|
|
|
|
void OnDefaultAuthentication (object sender, EventArgs args)
|
|
{
|
|
HttpApplication app = (HttpApplication) sender;
|
|
HttpContext context = app.Context;
|
|
|
|
if (context.User == null && Authenticate != null)
|
|
Authenticate (this, new DefaultAuthenticationEventArgs (context));
|
|
|
|
if (context.User == null)
|
|
context.User = new GenericPrincipal (defaultIdentity, new string [0]);
|
|
}
|
|
}
|
|
}
|
|
|