Author: kostat
Date: 2008-01-30 07:43:36 -0500 (Wed, 30 Jan 2008)
New Revision: 94368
Modified:
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/AuthenticationService.cs
Log:
ensure the authenticationService is enabled
Modified:
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/AuthenticationService.cs
===================================================================
---
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/AuthenticationService.cs
2008-01-30 12:28:32 UTC (rev 94367)
+++
trunk/mcs/class/System.Web.Extensions/System.Web.Script.Services/AuthenticationService.cs
2008-01-30 12:43:36 UTC (rev 94368)
@@ -46,21 +46,18 @@
_section = (ScriptingAuthenticationServiceSection)
WebConfigurationManager.GetSection
("system.web.extensions/scripting/webServices/authenticationService");
}
- ScriptingAuthenticationServiceSection
ScriptingProfileServiceSection {
- get {
- if (_section == null || !_section.Enabled)
- throw new InvalidOperationException
("Authentication service is disabled.");
+ void EnsureEnabled() {
+ if (_section == null || !_section.Enabled)
+ throw new InvalidOperationException
("Authentication service is disabled.");
- return _section;
- }
+ if (_section.RequireSSL &&
!HttpContext.Current.Request.IsSecureConnection)
+ throw new HttpException ("SSL is required for
this operation.");
}
[WebMethod ()]
public bool Login (string userName, string password, bool
createPersistentCookie) {
+ EnsureEnabled ();
- if (ScriptingProfileServiceSection.RequireSSL &&
!HttpContext.Current.Request.IsSecureConnection)
- throw new HttpException ("SSL is required for
this operation.");
-
if (!Membership.Provider.ValidateUser (userName,
password))
return false;
@@ -71,6 +68,8 @@
[WebMethod ()]
public void Logout () {
+ EnsureEnabled ();
+
FormsAuthentication.SignOut ();
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches