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

  872 Reggie Burnett	2011-02-14 [merge]
      merged

    modified:
      CHANGES
      MySql.Web/Providers/Source/MembershipProvider.cs
      MySql.Web/Tests/UserManagement.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES	2011-02-14 17:11:07 +0000
+++ b/CHANGES	2011-02-14 19:20:58 +0000
@@ -23,6 +23,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.1.5
 - 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 23:03:40 +0000
+++ b/MySql.Web/Providers/Source/MembershipProvider.cs	2011-02-14 19:20:58 +0000
@@ -192,7 +192,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	2010-08-18 19:03:33 +0000
+++ b/MySql.Web/Tests/UserManagement.cs	2011-02-14 19:20:58 +0000
@@ -666,5 +666,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"));
+        }
     }
 }

No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).
Thread
bzr commit into connector-net-6.1 branch (reggie.burnett:872) Reggie Burnett14 Feb