List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:February 14 2011 7:20pm
Subject:bzr commit into connector-net-6.0 branch (reggie.burnett:859) Bug#59438
Bug#11770465
View as plain text  
#At file:///C:/Users/Reggie/work/connector-net/6.0/ based on revid:reggie.burnett@stripped

  859 Reggie Burnett	2011-02-14
      - fixed bug that prevented setting the membershipprovider's ApplicationName property at runtime
        (MySQL bug #59438, Oracle bug #11770465)

    modified:
      CHANGES
      MySql.Web/Providers/Source/MembershipProvider.cs
      MySql.Web/Tests/UserManagement.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES	2011-02-14 16:45:56 +0000
+++ b/CHANGES	2011-02-14 19:20:39 +0000
@@ -22,6 +22,8 @@
 - small code adjustment to make sure our object enumeration works with MySQL 5.5
 - fixed exection of command ";" to throw a query was empty exception instead of IndexOutOfRangeException 
   (MySQL bug #59537, Oracle bug #11766433)
+- fixed bug that prevented setting the membershipprovider's ApplicationName property at runtime
+  (MySQL bug #59438, Oracle bug #11770465)
 
 Version 6.0.7
 - Fix authorization popup after modifying stored procedure in VS (Bug #44715)

=== modified file 'MySql.Web/Providers/Source/MembershipProvider.cs'
--- a/MySql.Web/Providers/Source/MembershipProvider.cs	2010-12-14 22:56:36 +0000
+++ b/MySql.Web/Providers/Source/MembershipProvider.cs	2011-02-14 19:20:39 +0000
@@ -190,7 +190,14 @@
         public override string ApplicationName
         {
             get { return app.Name; }
-            set { app.Name = value; }
+            set 
+            {
+                lock (this)
+                {
+                    if (value.ToLowerInvariant() == app.Name.ToLowerInvariant()) return;
+                    app = new Application(value, String.Empty);
+                }
+            }
         }
 
         /// <summary>

=== modified file 'MySql.Web/Tests/UserManagement.cs'
--- a/MySql.Web/Tests/UserManagement.cs	2009-08-04 15:12:04 +0000
+++ b/MySql.Web/Tests/UserManagement.cs	2011-02-14 19:20:39 +0000
@@ -664,5 +664,37 @@
             MembershipUser u = provider.GetUser("foo", false);
             string newpw = provider.ResetPassword("foo", null);
         }
+
+        /// <summary>
+        /// Bug #59438	setting Membership.ApplicationName has no effect
+        /// </summary>
+        [Test]
+        public void ChangeAppName()
+        {
+            provider = new MySQLMembershipProvider();
+            NameValueCollection config = new NameValueCollection();
+            config.Add("connectionStringName", "LocalMySqlServer");
+            config.Add("applicationName", "/");
+            config.Add("passwordStrengthRegularExpression", "bar.*");
+            config.Add("passwordFormat", "Clear");
+            provider.Initialize(null, config);
+            MembershipCreateStatus status;
+            provider.CreateUser("foo", "bar!bar", null, null, null, true, null, out status);
+            Assert.IsTrue(status == MembershipCreateStatus.Success);
+
+            MySQLMembershipProvider provider2 = new MySQLMembershipProvider();
+            NameValueCollection config2 = new NameValueCollection();
+            config2.Add("connectionStringName", "LocalMySqlServer");
+            config2.Add("applicationName", "/myapp");
+            config2.Add("passwordStrengthRegularExpression", "foo.*");
+            config2.Add("passwordFormat", "Clear");
+            provider2.Initialize(null, config2);
+            provider2.CreateUser("foo2", "foo!foo", null, null, null, true, null, out status);
+            Assert.IsTrue(status == MembershipCreateStatus.Success);
+
+            provider.ApplicationName = "/myapp";
+            Assert.IsFalse(provider.ValidateUser("foo", "bar!bar"));
+            Assert.IsTrue(provider.ValidateUser("foo2", "foo!foo"));
+        }
     }
 }


Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20110214192039-4wcgy2zliyz9p30e.bundle
Thread
bzr commit into connector-net-6.0 branch (reggie.burnett:859) Bug#59438Bug#11770465Reggie Burnett14 Feb