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

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

    modified:
      MySql.Web/Providers/Source/MembershipProvider.cs
      MySql.Web/Tests/UserManagement.cs
=== modified file 'MySql.Web/Providers/Source/MembershipProvider.cs'
=== modified file 'MySql.Web/Providers/Source/MembershipProvider.cs'
--- a/MySql.Web/Providers/Source/MembershipProvider.cs	2010-12-14 23:04:23 +0000
+++ b/MySql.Web/Providers/Source/MembershipProvider.cs	2011-02-14 19:21:23 +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:48:34 +0000
+++ b/MySql.Web/Tests/UserManagement.cs	2011-02-14 19:21:23 +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-trunk branch (reggie.burnett:956) Reggie Burnett14 Feb