From: Igor Zelmanovich Date: Thu, 19 Apr 2007 15:05:58 +0000 (-0000) Subject: 2007-04-19 Igor Zelmanovich X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=659624a8a9e200c77d859cf1fc948b6590c3de02;p=mono.git 2007-04-19 Igor Zelmanovich * DerbyMembershipProvider.cs: ChangePassword throws exception if new password has invalid format. svn path=/trunk/mcs/; revision=75956 --- diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/ChangeLog b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/ChangeLog index 90f0c5b6268..f2a30944446 100644 --- a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/ChangeLog +++ b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/ChangeLog @@ -1,3 +1,8 @@ +2007-04-19 Igor Zelmanovich + + * DerbyMembershipProvider.cs: + ChangePassword throws exception if new password has invalid format. + 2007-02-21 Vladimir Krasnov * DerbyMembershipProvider.cs: fixed Initialize, throw exception if no @@ -50,4 +55,4 @@ * DerbyMembershipHelper.cs: * DerbyMembershipProvider.cs: fixed CreateUser method, when user - already exists in Users table and adding Membership info \ No newline at end of file + already exists in Users table and adding Membership info diff --git a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyMembershipProvider.cs b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyMembershipProvider.cs index 7590f463661..95d66807154 100644 --- a/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyMembershipProvider.cs +++ b/mcs/class/Mainsoft.Web/Mainsoft.Web.Security/DerbyMembershipProvider.cs @@ -98,6 +98,12 @@ namespace Mainsoft.Web.Security { CheckParam ("oldPwd", oldPwd, 128); CheckParam ("newPwd", newPwd, 128); + if (!CheckPassword (newPwd)) + throw new ArgumentException (string.Format ( + "New Password invalid. New Password length minimum: {0}. Non-alphanumeric characters required: {1}.", + MinRequiredPasswordLength, + MinRequiredNonAlphanumericCharacters)); + using (DbConnection connection = CreateConnection ()) { PasswordInfo pi = ValidateUsingPassword (username, oldPwd);