bug fixes
authorIlya Kharmatsky <ilya@mono-cvs.ximian.com>
Thu, 15 Mar 2007 16:08:19 +0000 (16:08 -0000)
committerIlya Kharmatsky <ilya@mono-cvs.ximian.com>
Thu, 15 Mar 2007 16:08:19 +0000 (16:08 -0000)
svn path=/trunk/mcs/; revision=74392

mcs/class/Mainsoft.Web/Mainsoft.Web.J2EE.WAS/Mainsoft.Web.Security/ChangeLog
mcs/class/Mainsoft.Web/Mainsoft.Web.J2EE.WAS/Mainsoft.Web.Security/WPMembershipProvider.cs

index a3338aa47f3416954a5d21ae05fdc11216cb2d56..998094786b018796df972120a19115e6adac4bbc 100755 (executable)
@@ -1,66 +1,70 @@
-03-23-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>\r
-       * WPAuthenticationModule.cs: fixed in WPPrincipal class method -\r
-       IsInRole - we are leaving this for RoleBasedPrincipal class to handle\r
-       this method.\r
-\r
-03-12-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>\r
-\r
-       * WPAuthenticationModule.cs: added to project. Portal specific\r
-       authentication module (uses PUMA services)\r
-       * IPumaServicesProvider.cs, PumaServicesProvider.cs,\r
-       WPGroupsRoleProvider.cs: added 'CurrentUserName' property and \r
-       internal helpers methods.\r
-\r
-03-01-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>\r
-\r
-       * PumaServicesProvider.cs: fixed PumaController property (proper\r
-       handling process action phace)\r
-\r
-02-26-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>\r
-       \r
-       * WPGroupsRoleProvider.cs: fixed RoleExists method - in case when\r
-       wildcard used in roleName parameter.\r
-\r
-02-26-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>\r
-\r
-       * Added comments, NET_2_0 derective to all classes under this\r
-       directory.\r
-\r
-02-26-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>\r
-\r
-       * WPS*.cs : renamed to WP*.cs files and respective classes.\r
-       * WPGroupsRoleProvider.cs: small fixes in implemented read-only\r
-       features\r
-       * PumaServicesProvider.cs: changed implementation of obtaining\r
-       configuration properties - use JNDI repository and cache it in\r
-       portlet/servlet session.\r
-\r
-03-12-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>\r
-\r
-       * PumaServicesProvider.cs: fixed TD BUG: 7489 (the application\r
-       should not throw an exeption even if no WPGroupsRoleNamespace is not\r
-       defined in web.xml)\r
-\r
-02-25-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>\r
-\r
-       * WPSGroupsRoleProvider.cs: added\r
-       * WPSMembershipProvider.cs, WPSMembershipUser.cs: added NET_2_0\r
-       directives.\r
-\r
-02-21-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>\r
-\r
-       * WPSMembershipProvider.cs: fixed 'null' case in GetUser methods - \r
-         should return 'current user'\r
-\r
-02-20-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>\r
-\r
-       * WPSMembershipProvider.cs : fixed paging of resources.\r
-\r
-02-19-2007     Ilya Kharmatsky    <ilyak -at- mainsoft.com>\r
-\r
-       * IPumaServicesProvider.cs, PumaServicesProvider.cs,\r
-         PumaServicesProviderFactory.cs, WPSMembershipProvider.cs,\r
-         WPSMembershipUser.cs : Added to the project - implementation of\r
-         Web Sphere Portal MembershipProvider and Web Sphere Portal \r
-         MembershipUser - based on PUMA API.\r
-\r
+03-23-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>
+       
+       * WPMembershipProvider.cs: bug fixes 
+
+03-23-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>
+       * WPAuthenticationModule.cs: fixed in WPPrincipal class method -
+       IsInRole - we are leaving this for RoleBasedPrincipal class to handle
+       this method.
+
+03-12-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>
+
+       * WPAuthenticationModule.cs: added to project. Portal specific
+       authentication module (uses PUMA services)
+       * IPumaServicesProvider.cs, PumaServicesProvider.cs,
+       WPGroupsRoleProvider.cs: added 'CurrentUserName' property and 
+       internal helpers methods.
+
+03-01-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>
+
+       * PumaServicesProvider.cs: fixed PumaController property (proper
+       handling process action phace)
+
+02-26-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>
+       
+       * WPGroupsRoleProvider.cs: fixed RoleExists method - in case when
+       wildcard used in roleName parameter.
+
+02-26-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>
+
+       * Added comments, NET_2_0 derective to all classes under this
+       directory.
+
+02-26-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>
+
+       * WPS*.cs : renamed to WP*.cs files and respective classes.
+       * WPGroupsRoleProvider.cs: small fixes in implemented read-only
+       features
+       * PumaServicesProvider.cs: changed implementation of obtaining
+       configuration properties - use JNDI repository and cache it in
+       portlet/servlet session.
+
+03-12-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>
+
+       * PumaServicesProvider.cs: fixed TD BUG: 7489 (the application
+       should not throw an exeption even if no WPGroupsRoleNamespace is not
+       defined in web.xml)
+
+02-25-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>
+
+       * WPSGroupsRoleProvider.cs: added
+       * WPSMembershipProvider.cs, WPSMembershipUser.cs: added NET_2_0
+       directives.
+
+02-21-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>
+
+       * WPSMembershipProvider.cs: fixed 'null' case in GetUser methods - 
+         should return 'current user'
+
+02-20-2007      Ilya Kharmatsky    <ilyak -at- mainsoft.com>
+
+       * WPSMembershipProvider.cs : fixed paging of resources.
+
+02-19-2007     Ilya Kharmatsky    <ilyak -at- mainsoft.com>
+
+       * IPumaServicesProvider.cs, PumaServicesProvider.cs,
+         PumaServicesProviderFactory.cs, WPSMembershipProvider.cs,
+         WPSMembershipUser.cs : Added to the project - implementation of
+         Web Sphere Portal MembershipProvider and Web Sphere Portal 
+         MembershipUser - based on PUMA API.
+
index df01e16c3f4121441e2deb3fea87d6e523a169ef..14c9b1b39ac71a24b3e156b76203d49d4d2a3c1c 100644 (file)
@@ -145,8 +145,14 @@ namespace Mainsoft.Web.Security
         #region Implemented Methods\r
         public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords)\r
         {\r
-            if (emailToMatch == null || emailToMatch.Length > 256) // TODO check if the string could be null, if yes replace it with "*" for any email\r
-                throw new ArgumentException("Argument emailToMatch either null or length > 256", "emailToMatch");\r
+            if (emailToMatch == null)\r
+            {\r
+                totalRecords = 0;\r
+                return new MembershipUserCollection();\r
+            }\r
+\r
+            if (emailToMatch.Length > 256) \r
+                throw new ArgumentException("Argument emailToMatch has length > 256", "emailToMatch");\r
             if (pageIndex < 0)\r
                 throw new ArgumentException("Argument pageIndex could not be negative", "pageIndex");\r
             if (pageSize < 1)\r
@@ -178,8 +184,10 @@ namespace Mainsoft.Web.Security
 \r
         public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)\r
         {\r
-            if (usernameToMatch == null || usernameToMatch.Trim().Length == 0 || usernameToMatch.Trim().Length > 256)\r
-                throw new ArgumentException("Wrong username given as a parameter - could not be null or empty string and could not have more than 255 characters", usernameToMatch);\r
+            if (usernameToMatch == null)\r
+                throw new ArgumentNullException("username");\r
+            if (usernameToMatch.Trim().Length == 0 || usernameToMatch.Trim().Length > 256)\r
+                throw new ArgumentException("Wrong username given as a parameter - could not have more than 255 characters", usernameToMatch);\r
             if (pageIndex < 0)\r
                 throw new ArgumentException("Argument pageIndex could not be negative", "pageIndex");\r
             if (pageSize < 1)\r
@@ -235,13 +243,14 @@ namespace Mainsoft.Web.Security
         //the userIsOnline ignored\r
         public override MembershipUser GetUser(string username, bool userIsOnline)\r
         {\r
+            if (username == null)\r
+                throw new ArgumentNullException("username");\r
             if (username.Length > 256)\r
                 throw new ArgumentException("The username is too long", username);\r
-            IPumaServicesProvider provider = PumaServicesProviderFactory.CreateProvider();\r
-            \r
-            if (username == null || username == String.Empty)\r
-                return new WPMembershipUser(provider.CurrentUser);\r
+            if (username.IndexOf(',') != -1)\r
+                throw new ArgumentException("Comma symbol is not allowed in username");\r
 \r
+            IPumaServicesProvider provider = PumaServicesProviderFactory.CreateProvider();\r
             java.util.List principles =  provider.PumaLocator.findUsersByAttribute("uid", username);\r
             MembershipUser result = null;\r
             if (principles.size() > 0)\r