Bugfix for #81089
authorMarek Habersack <grendel@twistedcode.net>
Fri, 9 Mar 2007 14:16:04 +0000 (14:16 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Fri, 9 Mar 2007 14:16:04 +0000 (14:16 -0000)
svn path=/trunk/mcs/; revision=74002

mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
mcs/class/System.Web/System.Web.UI.WebControls/Login.cs
mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
mcs/class/System.Web/Test/System.Web.UI.WebControls/LoginTest.cs

index dfc1882ab7b165c4b0b971a3dfb4af1a1b3176bc..ca70ad302103051c8c2eb49f00c1471977eea75e 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-09  Marek Habersack  <mhabersack@novell.com>
+
+       * Login.cs: Make command name comparison case-insensitive in
+       OnBubbleEvent. Patch from Mike Morano <mmorano@mikeandwan.us>
+
 2007-03-06 Igor Zelmanovich <igorz@mainsoft.com>
 
        * DataGrid.cs: fixed: 
index c86d20c6e0a0534256d14ea28ec6f4253f509e42..7c97b862c36893f997c14286eb437b4b0c391a79 100644 (file)
@@ -1095,7 +1095,8 @@ namespace System.Web.UI.WebControls {
                {
                        // check for submit button
                        CommandEventArgs cea = (e as CommandEventArgs);
-                       if ((cea != null) && (cea.CommandName == LoginButtonCommandName)) {
+                       if ((cea != null) &&
+                           String.Equals (cea.CommandName, LoginButtonCommandName, StringComparison.InvariantCultureIgnoreCase)) {
                                if (!AuthenticateUser ()) {
                                        ITextControl failureText = LoginTemplateContainer.FailureTextLiteral;
                                        if (failureText != null)
index 67408a400027a045fe6160f49475e30abb637779..492b3a82f613ca183be313ef96738379f67c1521 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-09  Marek Habersack  <mhabersack@novell.com>
+
+       * LoginTest.cs: Added a test for case-insensitive command name in
+       OnBubbleEvent.
+
 2007-02-28 Igor Zelmanovich <igorz@mainsoft.com>
 
        * TreeNodeColectionTest.cs: new tests
index 5ffd4cc2f652f03679a947b60b7f9fb11b7372d0..c416a4da8b198c7c0f790ffa49d61a8009dfaf13 100644 (file)
@@ -800,7 +800,7 @@ namespace MonoTests.System.Web.UI.WebControls {
                        string html = t.Run ();
                }
 
-               public static void _OnBubbleEvent(Page p)
+               public static void DoOnBubbleEvent(Page p, string cmdname)
                {
                        TestLogin l = new TestLogin ();
                        l.Page = p;
@@ -808,7 +808,7 @@ namespace MonoTests.System.Web.UI.WebControls {
                        l.MembershipProvider = "FakeProvider";
                        Button b = (Button)l.FindControl ("LoginButton");
                        Assert.IsNotNull (b, "LoginButton");
-                       CommandEventArgs cea = new CommandEventArgs ("Login", null);
+                       CommandEventArgs cea = new CommandEventArgs (cmdname, null);
                        l.DoBubbleEvent (b, cea);
                        Assert.IsTrue (l.OnLoggingInCalled, "OnLoggingIn");
                        Assert.IsFalse (l.Cancel, "Cancel");
@@ -817,7 +817,25 @@ namespace MonoTests.System.Web.UI.WebControls {
                        Assert.IsTrue (l.OnLoginErrorCalled, "OnLoginError");
                        Assert.IsFalse (l.OnLoggedInCalled, "OnLoggedIn");
                }
+               
+               public static void _OnBubbleEvent(Page p)
+               {
+                       DoOnBubbleEvent(p, "Login");
+               }
 
+               [Test]
+               [Category ("NunitWeb")]
+               public void OnBubbleEventCaseSensitivity ()
+               {
+                       WebTest t = new WebTest (PageInvoker.CreateOnPreInit (_OnBubbleEventCaseSensitivity));
+                       string html = t.Run ();
+               }
+               
+               public static void _OnBubbleEventCaseSensitivity(Page p)
+               {
+                       DoOnBubbleEvent(p, "login");
+               }
+               
                [Test]
                public void OnBubbleEvent_Cancel_OnLoggingIn ()
                {