Jelajahi Sumber

2004-11-18 Lluis Sanchez Gual <[email protected]>

	* RoleProvider.cs, Roles.cs, SqlRoleProvider.cs, RoleProviderCollection.cs,
	AccessRoleProvider.cs: IRoleProvider has been renamed to ProviderBase.
	* IMembershipProvider.cs: Deleted.
	* MembershipProvider.cs, AccessMembershipProvider.cs, MembershipUser.cs,
	Membership.cs, ADMembershipProvider.cs, SqlMembershipProvider.cs
	MembershipProviderCollection.cs: MembershipProvider has been deleted
	and replaced by the abstract class MembershipProvider.
	* MembershipProviderCollection.cs: Minor fixes.
	* ADMembershipProvider.cs: Renamed to ActiveDirectoryMembershipProvider.cs.


svn path=/trunk/mcs/; revision=36274
Lluis Sanchez 21 tahun lalu
induk
melakukan
c99594ef82

+ 30 - 22
mcs/class/System.Web/System.Web.Security/AccessMembershipProvider.cs

@@ -3,6 +3,7 @@
 //
 // Authors:
 //	Ben Maurer ([email protected])
+//	Lluis Sanchez Gual ([email protected])
 //
 // (C) 2003 Ben Maurer
 //
@@ -34,28 +35,28 @@ using System.Collections.Specialized;
 using System.Text;
 
 namespace System.Web.Security {
-	public class AccessMembershipProvider : IMembershipProvider {
+	public class AccessMembershipProvider : MembershipProvider {
 		
 		[MonoTODO]
-		public virtual bool ChangePassword (string username, string oldPwd, string newPwd)
+		public override bool ChangePassword (string username, string oldPwd, string newPwd)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual bool ChangePasswordQuestionAndAnswer (string username, string password, string newPwdQuestion, string newPwdAnswer)
+		public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPwdQuestion, string newPwdAnswer)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual MembershipUser CreateUser (string username, string password, string email,  out MembershipCreateStatus status)
+		public override MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, out MembershipCreateStatus status)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual bool DeleteUser (string username)
+		public override bool DeleteUser (string username, bool deleteAllRelatedData)
 		{
 			throw new NotImplementedException ();
 		}
@@ -67,82 +68,89 @@ namespace System.Web.Security {
 		}
 		
 		[MonoTODO]
-		public MembershipUserCollection GetAllUsers ()
+		public override MembershipUserCollection FindUsersByEmail (string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public int GetNumberOfUsersOnline ()
+		public override MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string GetPassword (string username, string answer)
+		public override MembershipUserCollection GetAllUsers (int pageIndex, int pageSize, out int totalRecords)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual MembershipUser GetUser (string username, bool userIsOnline)
+		public override int GetNumberOfUsersOnline ()
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string GetUserNameByEmail (string email)
+		public override string GetPassword (string username, string answer)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual void Initialize (string name, NameValueCollection config)
+		public override MembershipUser GetUser (string username, bool userIsOnline)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string ResetPassword (string username, string answer)
+		public override string GetUserNameByEmail (string email)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual void UpdateUser (MembershipUser user)
+		public override void Initialize (string name, NameValueCollection config)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual bool ValidateUser (string username, string password)
+		public override string ResetPassword (string username, string answer)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public string ApplicationName {
-			get { throw new NotImplementedException (); }
-			set { throw new NotImplementedException (); }
+		public override void UpdateUser (MembershipUser user)
+		{
+			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string Description {
+		public override bool ValidateUser (string username, string password)
+		{
+			throw new NotImplementedException ();
+		}
+		
+		[MonoTODO]
+		public override string ApplicationName {
 			get { throw new NotImplementedException (); }
+			set { throw new NotImplementedException (); }
 		}
 		
 		[MonoTODO]
-		public virtual bool EnablePasswordReset {
+		public virtual string Description {
 			get { throw new NotImplementedException (); }
 		}
 		
 		[MonoTODO]
-		public virtual bool EnablePasswordRetrieval {
+		public override bool EnablePasswordReset {
 			get { throw new NotImplementedException (); }
 		}
 		
 		[MonoTODO]
-		public virtual string Name {
+		public override bool EnablePasswordRetrieval {
 			get { throw new NotImplementedException (); }
 		}
 		
@@ -152,7 +160,7 @@ namespace System.Web.Security {
 		}
 		
 		[MonoTODO]
-		public virtual bool RequiresQuestionAndAnswer {
+		public override bool RequiresQuestionAndAnswer {
 			get { throw new NotImplementedException (); }
 		}
 		

+ 17 - 16
mcs/class/System.Web/System.Web.Security/AccessRoleProvider.cs

@@ -34,81 +34,82 @@ using System.Collections.Specialized;
 using System.Text;
 
 namespace System.Web.Security {
-	public class AccessRoleProvider {
+	public class AccessRoleProvider: RoleProvider {
 		
 		[MonoTODO]
-		public void AddUsersToRoles (string [] usernames, string [] rolenames)
+		public override void AddUsersToRoles (string [] usernames, string [] rolenames)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public void CreateRole (string rolename)
+		public override void CreateRole (string rolename)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public void DeleteRole (string rolename)
+		public override void DeleteRole (string rolename, bool throwOnPopulatedRole)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public string [] GetAllRoles ()
+		public override void FindUsersInRole (string roleName, string usernameToMatch)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public string [] GetRolesForUser (string username)
+		public override string [] GetAllRoles ()
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public string [] GetUsersInRole (string rolename)
+		public override string [] GetRolesForUser (string username)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual void Initialize (string name, NameValueCollection config)
+		public override string [] GetUsersInRole (string rolename)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public bool IsUserInRole (string username, string rolename)
+		public override void Initialize (string name, NameValueCollection config)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public void RemoveUsersFromRoles (string [] usernames, string [] rolenames)
+		public override bool IsUserInRole (string username, string rolename)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public bool RoleExists (string rolename)
+		public override void RemoveUsersFromRoles (string [] usernames, string [] rolenames)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public string ApplicationName {
-			get { throw new NotImplementedException (); }
-			set { throw new NotImplementedException (); }
+		public override bool RoleExists (string rolename)
+		{
+			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string Description {
+		public override string ApplicationName {
 			get { throw new NotImplementedException (); }
+			set { throw new NotImplementedException (); }
 		}
 		
 		[MonoTODO]
-		public virtual string Name {
+		public virtual string Description {
 			get { throw new NotImplementedException (); }
 		}
 	}

+ 31 - 23
mcs/class/System.Web/System.Web.Security/ADMembershipProvider.cs → mcs/class/System.Web/System.Web.Security/ActiveDirectoryMembershipProvider.cs

@@ -1,8 +1,9 @@
 //
-// System.Web.Security.ADMembershipProvider
+// System.Web.Security.ActiveDirectoryMembershipProvider
 //
 // Authors:
 //	Ben Maurer ([email protected])
+//	Lluis Sanchez Gual ([email protected])
 //
 // (C) 2003 Ben Maurer
 //
@@ -34,28 +35,28 @@ using System.Collections.Specialized;
 using System.Text;
 
 namespace System.Web.Security {
-	public class ADMembershipProvider : IMembershipProvider {
+	public class ActiveDirectoryMembershipProvider : MembershipProvider {
 		
 		[MonoTODO]
-		public virtual bool ChangePassword (string username, string oldPwd, string newPwd)
+		public override bool ChangePassword (string username, string oldPwd, string newPwd)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual bool ChangePasswordQuestionAndAnswer (string username, string password, string newPwdQuestion, string newPwdAnswer)
+		public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPwdQuestion, string newPwdAnswer)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual MembershipUser CreateUser (string username, string password, string email,  out MembershipCreateStatus status)
+		public override MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, out MembershipCreateStatus status)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual bool DeleteUser (string username)
+		public override bool DeleteUser (string username, bool deleteAllRelatedData)
 		{
 			throw new NotImplementedException ();
 		}
@@ -67,82 +68,89 @@ namespace System.Web.Security {
 		}
 		
 		[MonoTODO]
-		public MembershipUserCollection GetAllUsers ()
+		public override MembershipUserCollection FindUsersByEmail (string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public int GetNumberOfUsersOnline ()
+		public override MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string GetPassword (string username, string answer)
+		public override MembershipUserCollection GetAllUsers (int pageIndex, int pageSize, out int totalRecords)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual MembershipUser GetUser (string username, bool userIsOnline)
+		public override int GetNumberOfUsersOnline ()
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string GetUserNameByEmail (string email)
+		public override string GetPassword (string username, string answer)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual void Initialize (string name, NameValueCollection config)
+		public override MembershipUser GetUser (string username, bool userIsOnline)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string ResetPassword (string username, string answer)
+		public override string GetUserNameByEmail (string email)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual void UpdateUser (MembershipUser user)
+		public override void Initialize (string name, NameValueCollection config)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual bool ValidateUser (string username, string password)
+		public override string ResetPassword (string username, string answer)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public string ApplicationName {
-			get { throw new NotImplementedException (); }
-			set { throw new NotImplementedException (); }
+		public override void UpdateUser (MembershipUser user)
+		{
+			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string Description {
+		public override bool ValidateUser (string username, string password)
+		{
+			throw new NotImplementedException ();
+		}
+		
+		[MonoTODO]
+		public override string ApplicationName {
 			get { throw new NotImplementedException (); }
+			set { throw new NotImplementedException (); }
 		}
 		
 		[MonoTODO]
-		public virtual bool EnablePasswordReset {
+		public virtual string Description {
 			get { throw new NotImplementedException (); }
 		}
 		
 		[MonoTODO]
-		public virtual bool EnablePasswordRetrieval {
+		public override bool EnablePasswordReset {
 			get { throw new NotImplementedException (); }
 		}
 		
 		[MonoTODO]
-		public virtual string Name {
+		public override bool EnablePasswordRetrieval {
 			get { throw new NotImplementedException (); }
 		}
 		
@@ -152,7 +160,7 @@ namespace System.Web.Security {
 		}
 		
 		[MonoTODO]
-		public virtual bool RequiresQuestionAndAnswer {
+		public override bool RequiresQuestionAndAnswer {
 			get { throw new NotImplementedException (); }
 		}
 		

+ 12 - 0
mcs/class/System.Web/System.Web.Security/ChangeLog

@@ -1,3 +1,15 @@
+2004-11-18 Lluis Sanchez Gual <[email protected]>
+
+	* RoleProvider.cs, Roles.cs, SqlRoleProvider.cs, RoleProviderCollection.cs,
+	AccessRoleProvider.cs: IRoleProvider has been renamed to ProviderBase.
+	* IMembershipProvider.cs: Deleted.
+	* MembershipProvider.cs, AccessMembershipProvider.cs, MembershipUser.cs,
+	Membership.cs, ADMembershipProvider.cs, SqlMembershipProvider.cs
+	MembershipProviderCollection.cs: MembershipProvider has been deleted
+	and replaced by the abstract class MembershipProvider.
+	* MembershipProviderCollection.cs: Minor fixes.
+	* ADMembershipProvider.cs: Renamed to ActiveDirectoryMembershipProvider.cs.
+
 2004-11-15 Lluis Sanchez Gual <[email protected]>
 
 	* RoleProviderCollection.cs, MembershipProviderCollection.cs: 

+ 0 - 55
mcs/class/System.Web/System.Web.Security/IMembershipProvider.cs

@@ -1,55 +0,0 @@
-//
-// System.Web.Security.IMembershipProvider
-//
-// Authors:
-//	Ben Maurer ([email protected])
-//
-// (C) 2003 Ben Maurer
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-using System.Configuration.Provider;
-
-namespace System.Web.Security {
-	public interface IMembershipProvider : IProvider {
-		bool ChangePassword (string name, string oldPwd, string newPwd);
-		bool ChangePasswordQuestionAndAnswer (string name, string password, string newPwdQuestion, string newPwdAnswer);
-		MembershipUser CreateUser (string username, string password, string email, out MembershipCreateStatus status);
-		bool DeleteUser (string name);
-		MembershipUserCollection GetAllUsers ();
-		int GetNumberOfUsersOnline ();
-		string GetPassword (string name, string answer);
-		MembershipUser GetUser (string name, bool userIsOnline);
-		string GetUserNameByEmail (string email);
-		string ResetPassword (string name, string answer);
-		void UpdateUser (MembershipUser user);
-		bool ValidateUser (string name, string password);
-		string ApplicationName { get; set; }
-		bool EnablePasswordReset { get; }
-		bool EnablePasswordRetrieval { get; }
-		bool RequiresQuestionAndAnswer { get; }
-	}
-}
-#endif
-

+ 19 - 6
mcs/class/System.Web/System.Web.Security/Membership.cs

@@ -36,6 +36,8 @@ using System.Text;
 namespace System.Web.Security {
 	public sealed class Membership {
 		
+		private Membership () {}
+		
 		public static MembershipUser CreateUser (string username, string password)
 		{
 			return CreateUser (username, password, null);
@@ -44,21 +46,26 @@ namespace System.Web.Security {
 		public static MembershipUser CreateUser (string username, string password, string email)
 		{
 			MembershipCreateStatus status;
-			MembershipUser usr = CreateUser (username, password, email, out status);
+			MembershipUser usr = CreateUser (username, password, email, null, null, true, out status);
 			if (usr == null)
 				throw new MembershipCreateUserException (status);
 			
 			return usr;
 		}
 		
-		public static MembershipUser CreateUser (string username, string password, string email, out MembershipCreateStatus status)
+		public static MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, out MembershipCreateStatus status)
 		{
-			return Provider.CreateUser (username, password, email, out status);
+			return Provider.CreateUser (username, password, email, pwdQuestion, pwdAnswer, isApproved, out status);
 		}
 		
 		public static bool DeleteUser (string username)
 		{
-			return Provider.DeleteUser (username);
+			return Provider.DeleteUser (username, true);
+		}
+		
+		public static bool DeleteUser (string username, bool deleteAllRelatedData)
+		{
+			return Provider.DeleteUser (username, deleteAllRelatedData);
 		}
 		
 		[MonoTODO]
@@ -69,7 +76,13 @@ namespace System.Web.Security {
 		
 		public static MembershipUserCollection GetAllUsers ()
 		{
-			return Provider.GetAllUsers ();
+			int total;
+			return GetAllUsers (1, int.MaxValue, out total);
+		}
+		
+		public static MembershipUserCollection GetAllUsers (int pageIndex, int pageSize, out int totalRecords)
+		{
+			return Provider.GetAllUsers (pageIndex, pageSize, out totalRecords);
 		}
 		
 		public static int GetNumberOfUsersOnline ()
@@ -130,7 +143,7 @@ namespace System.Web.Security {
 		}
 		
 		[MonoTODO]
-		public static IMembershipProvider Provider {
+		public static MembershipProvider Provider {
 			get { throw new NotImplementedException (); }
 		}
 		

+ 64 - 0
mcs/class/System.Web/System.Web.Security/MembershipProvider.cs

@@ -0,0 +1,64 @@
+//
+// System.Web.Security.IMembershipProvider
+//
+// Authors:
+//	Ben Maurer ([email protected])
+//	Lluis Sanchez Gual ([email protected])
+//
+// (C) 2003 Ben Maurer
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+using System.Configuration.Provider;
+
+namespace System.Web.Security
+{
+	public abstract class MembershipProvider : ProviderBase
+	{
+		protected MembershipProvider ()
+		{
+		}
+		
+		public abstract bool ChangePassword (string name, string oldPwd, string newPwd);
+		public abstract bool ChangePasswordQuestionAndAnswer (string name, string password, string newPwdQuestion, string newPwdAnswer);
+		public abstract MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, out MembershipCreateStatus status);
+		public abstract bool DeleteUser (string name, bool deleteAllRelatedData);
+		public abstract MembershipUserCollection FindUsersByEmail (string emailToMatch, int pageIndex, int pageSize, out int totalRecords);
+		public abstract MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords);
+		public abstract MembershipUserCollection GetAllUsers (int pageIndex, int pageSize, out int totalRecords);
+		public abstract int GetNumberOfUsersOnline ();
+		public abstract string GetPassword (string name, string answer);
+		public abstract MembershipUser GetUser (string name, bool userIsOnline);
+		public abstract string GetUserNameByEmail (string email);
+		public abstract string ResetPassword (string name, string answer);
+		public abstract void UpdateUser (MembershipUser user);
+		public abstract bool ValidateUser (string name, string password);
+		public abstract string ApplicationName { get; set; }
+		public abstract bool EnablePasswordReset { get; }
+		public abstract bool EnablePasswordRetrieval { get; }
+		public abstract bool RequiresQuestionAndAnswer { get; }
+	}
+}
+#endif
+

+ 4 - 4
mcs/class/System.Web/System.Web.Security/MembershipProviderCollection.cs

@@ -33,16 +33,16 @@ using System.Configuration.Provider;
 
 namespace System.Web.Security {
 	public class MembershipProviderCollection : ProviderCollection {
-		public override void Add (IProvider provider)
+		public override void Add (ProviderBase provider)
 		{
-			if (provider is IMembershipProvider)
+			if (provider is MembershipProvider)
 				base.Add (provider);
 			else
 				throw new HttpException ();
 		}
 		
-		public new IMembershipProvider this [string name] {
-			get { return (IMembershipProvider) base [name]; }
+		public new MembershipProvider this [string name] {
+			get { return (MembershipProvider) base [name]; }
 		}
 	}
 }

+ 3 - 3
mcs/class/System.Web/System.Web.Security/MembershipUser.cs

@@ -35,7 +35,7 @@ namespace System.Web.Security {
 		{
 		}
 		
-		public MembershipUser (IMembershipProvider provider, string name, string email,
+		public MembershipUser (MembershipProvider provider, string name, string email,
 			string passwordQuestion, string comment, bool isApproved,
 			DateTime creationDate, DateTime lastLoginDate, DateTime lastActivityDate,
 			DateTime lastPasswordChangedDate)
@@ -138,7 +138,7 @@ namespace System.Web.Security {
 			get { return passwordQuestion; }
 		}
 		
-		public virtual IMembershipProvider Provider {
+		public virtual MembershipProvider Provider {
 			get { return provider; }
 		}
 		
@@ -146,7 +146,7 @@ namespace System.Web.Security {
 			get { return name; }
 		}
 		
-		IMembershipProvider provider;
+		MembershipProvider provider;
 		string name;
 		string email;
 		string passwordQuestion;

+ 19 - 12
mcs/class/System.Web/System.Web.Security/IRoleProvider.cs → mcs/class/System.Web/System.Web.Security/RoleProvider.cs

@@ -31,18 +31,25 @@
 #if NET_2_0
 using System.Configuration.Provider;
 
-namespace System.Web.Security {
-	public interface IRoleProvider : IProvider {
-		void AddUsersToRoles (string [] usernames, string [] rolenames);
-		void CreateRole (string rolename);
-		void DeleteRole (string rolename);
-		string [] GetAllRoles ();
-		string [] GetRolesForUser (string username);
-		string [] GetUsersInRole (string rolename);
-		bool IsUserInRole (string username, string rolename);
-		void RemoveUsersFromRoles (string [] usernames, string [] rolenames);
-		bool RoleExists (string rolename);
-		string ApplicationName { get; set; }
+namespace System.Web.Security
+{
+	public abstract class RoleProvider : ProviderBase
+	{
+		protected RoleProvider ()
+		{
+		}
+		
+		public abstract void AddUsersToRoles (string [] usernames, string [] rolenames);
+		public abstract void CreateRole (string rolename);
+		public abstract void DeleteRole (string rolename, bool throwOnPopulatedRole);
+		public abstract void FindUsersInRole (string roleName, string usernameToMatch);
+		public abstract string [] GetAllRoles ();
+		public abstract string [] GetRolesForUser (string username);
+		public abstract string [] GetUsersInRole (string rolename);
+		public abstract bool IsUserInRole (string username, string rolename);
+		public abstract void RemoveUsersFromRoles (string [] usernames, string [] rolenames);
+		public abstract bool RoleExists (string rolename);
+		public abstract string ApplicationName { get; set; }
 	}
 }
 #endif

+ 4 - 4
mcs/class/System.Web/System.Web.Security/RoleProviderCollection.cs

@@ -33,16 +33,16 @@ using System.Configuration.Provider;
 
 namespace System.Web.Security {
 	public class RoleProviderCollection : ProviderCollection {
-		public override void Add (IProvider provider)
+		public override void Add (ProviderBase provider)
 		{
-			if (provider is IRoleProvider)
+			if (provider is RoleProvider)
 				base.Add (provider);
 			else
 				throw new HttpException ();
 		}
 		
-		public new IRoleProvider this [string name] {
-			get { return (IRoleProvider) base [name]; }
+		public new RoleProvider this [string name] {
+			get { return (RoleProvider) base [name]; }
 		}
 	}
 }

+ 1 - 1
mcs/class/System.Web/System.Web.Security/Roles.cs

@@ -191,7 +191,7 @@ namespace System.Web.Security {
 		}
 		
 		[MonoTODO]
-		public static IRoleProvider Provider {
+		public static RoleProvider Provider {
 			get { throw new NotImplementedException (); }
 		}
 		

+ 30 - 22
mcs/class/System.Web/System.Web.Security/SqlMembershipProvider.cs

@@ -3,6 +3,7 @@
 //
 // Authors:
 //	Ben Maurer ([email protected])
+//	Lluis Sanchez Gual ([email protected])
 //
 // (C) 2003 Ben Maurer
 //
@@ -34,28 +35,28 @@ using System.Collections.Specialized;
 using System.Text;
 
 namespace System.Web.Security {
-	public class SqlMembershipProvider : IMembershipProvider {
+	public class SqlMembershipProvider : MembershipProvider {
 		
 		[MonoTODO]
-		public virtual bool ChangePassword (string username, string oldPwd, string newPwd)
+		public override bool ChangePassword (string username, string oldPwd, string newPwd)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual bool ChangePasswordQuestionAndAnswer (string username, string password, string newPwdQuestion, string newPwdAnswer)
+		public override bool ChangePasswordQuestionAndAnswer (string username, string password, string newPwdQuestion, string newPwdAnswer)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual MembershipUser CreateUser (string username, string password, string email,  out MembershipCreateStatus status)
+		public override MembershipUser CreateUser (string username, string password, string email, string pwdQuestion, string pwdAnswer, bool isApproved, out MembershipCreateStatus status)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual bool DeleteUser (string username)
+		public override bool DeleteUser (string username, bool deleteAllRelatedData)
 		{
 			throw new NotImplementedException ();
 		}
@@ -67,82 +68,89 @@ namespace System.Web.Security {
 		}
 		
 		[MonoTODO]
-		public MembershipUserCollection GetAllUsers ()
+		public override MembershipUserCollection FindUsersByEmail (string emailToMatch, int pageIndex, int pageSize, out int totalRecords)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public int GetNumberOfUsersOnline ()
+		public override MembershipUserCollection FindUsersByName (string nameToMatch, int pageIndex, int pageSize, out int totalRecords)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string GetPassword (string username, string answer)
+		public override MembershipUserCollection GetAllUsers (int pageIndex, int pageSize, out int totalRecords)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual MembershipUser GetUser (string username, bool userIsOnline)
+		public override int GetNumberOfUsersOnline ()
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string GetUserNameByEmail (string email)
+		public override string GetPassword (string username, string answer)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual void Initialize (string name, NameValueCollection config)
+		public override MembershipUser GetUser (string username, bool userIsOnline)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string ResetPassword (string username, string answer)
+		public override string GetUserNameByEmail (string email)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual void UpdateUser (MembershipUser user)
+		public override void Initialize (string name, NameValueCollection config)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual bool ValidateUser (string username, string password)
+		public override string ResetPassword (string username, string answer)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public string ApplicationName {
-			get { throw new NotImplementedException (); }
-			set { throw new NotImplementedException (); }
+		public override void UpdateUser (MembershipUser user)
+		{
+			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string Description {
+		public override bool ValidateUser (string username, string password)
+		{
+			throw new NotImplementedException ();
+		}
+		
+		[MonoTODO]
+		public override string ApplicationName {
 			get { throw new NotImplementedException (); }
+			set { throw new NotImplementedException (); }
 		}
 		
 		[MonoTODO]
-		public virtual bool EnablePasswordReset {
+		public virtual string Description {
 			get { throw new NotImplementedException (); }
 		}
 		
 		[MonoTODO]
-		public virtual bool EnablePasswordRetrieval {
+		public override bool EnablePasswordReset {
 			get { throw new NotImplementedException (); }
 		}
 		
 		[MonoTODO]
-		public virtual string Name {
+		public override bool EnablePasswordRetrieval {
 			get { throw new NotImplementedException (); }
 		}
 		
@@ -152,7 +160,7 @@ namespace System.Web.Security {
 		}
 		
 		[MonoTODO]
-		public virtual bool RequiresQuestionAndAnswer {
+		public override bool RequiresQuestionAndAnswer {
 			get { throw new NotImplementedException (); }
 		}
 		

+ 17 - 16
mcs/class/System.Web/System.Web.Security/SqlRoleProvider.cs

@@ -34,81 +34,82 @@ using System.Collections.Specialized;
 using System.Text;
 
 namespace System.Web.Security {
-	public class SqlRoleProvider {
+	public class SqlRoleProvider: RoleProvider {
 		
 		[MonoTODO]
-		public void AddUsersToRoles (string [] usernames, string [] rolenames)
+		public override void AddUsersToRoles (string [] usernames, string [] rolenames)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public void CreateRole (string rolename)
+		public override void CreateRole (string rolename)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public void DeleteRole (string rolename)
+		public override void DeleteRole (string rolename, bool throwOnPopulatedRole)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public string [] GetAllRoles ()
+		public override void FindUsersInRole (string roleName, string usernameToMatch)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public string [] GetRolesForUser (string username)
+		public override string [] GetAllRoles ()
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public string [] GetUsersInRole (string rolename)
+		public override string [] GetRolesForUser (string username)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual void Initialize (string name, NameValueCollection config)
+		public override string [] GetUsersInRole (string rolename)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public bool IsUserInRole (string username, string rolename)
+		public override void Initialize (string name, NameValueCollection config)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public void RemoveUsersFromRoles (string [] usernames, string [] rolenames)
+		public override bool IsUserInRole (string username, string rolename)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public bool RoleExists (string rolename)
+		public override void RemoveUsersFromRoles (string [] usernames, string [] rolenames)
 		{
 			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public string ApplicationName {
-			get { throw new NotImplementedException (); }
-			set { throw new NotImplementedException (); }
+		public override bool RoleExists (string rolename)
+		{
+			throw new NotImplementedException ();
 		}
 		
 		[MonoTODO]
-		public virtual string Description {
+		public override string ApplicationName {
 			get { throw new NotImplementedException (); }
+			set { throw new NotImplementedException (); }
 		}
 		
 		[MonoTODO]
-		public virtual string Name {
+		public virtual string Description {
 			get { throw new NotImplementedException (); }
 		}
 	}