List:Commits« Previous MessageNext Message »
From:rburnett Date:May 24 2007 9:44pm
Subject:Connector/NET commit: r739 - in trunk: . MySql.Web/Source
View as plain text  
Modified:
   trunk/CHANGES
   trunk/MySql.Web/Source/Install.cs
   trunk/MySql.Web/Source/MembershipProvider.cs
   trunk/MySql.Web/Source/RoleProvider.cs
Log:
Bug #28648  	bug in user creation

Fixed this bug and also fixed the problem of integration into the Website Administration Tool.  Basically we needed to not throw an exception if the connection string comes in as null (which apparently can happen sometimes in the WAT)

Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES	2007-05-23 19:44:46 UTC (rev 738)
+++ trunk/CHANGES	2007-05-24 21:44:55 UTC (rev 739)
@@ -1,3 +1,7 @@
+Version 5.1.2
+  - Fixed integration with the Website Administration Tool.  Before this fix, the test link
+    was visible but did not work and  user management did not work.
+    
 Version 5.1.1
   - Fixed password property on MySqlConnectionStringBuilder to use PasswordPropertyText 
     attribute.  This causes dots to show instead of actual password text.

Modified: trunk/MySql.Web/Source/Install.cs
===================================================================
--- trunk/MySql.Web/Source/Install.cs	2007-05-23 19:44:46 UTC (rev 738)
+++ trunk/MySql.Web/Source/Install.cs	2007-05-24 21:44:55 UTC (rev 739)
@@ -125,11 +125,11 @@
             XmlElement newNode = (XmlElement)doc.CreateNode(XmlNodeType.Element, "add", "");
 
             // add the proper attributes
-            newNode.SetAttribute("name", "MySqlMembershipProvider");
+            newNode.SetAttribute("name", "MySQLMembershipProvider");
 
             // add the type attribute by reflecting on the executing assembly
             Assembly a = Assembly.GetExecutingAssembly();
-            string type = String.Format("MySql.Web.Security.MySqlMembershipProvider, {0}", a.FullName);
+            string type = String.Format("MySql.Web.Security.MySQLMembershipProvider, {0}", a.FullName);
             newNode.SetAttribute("type", type);
 
             newNode.SetAttribute("connectionStringName", "LocalMySqlServer");
@@ -169,11 +169,11 @@
             XmlElement newNode = (XmlElement)doc.CreateNode(XmlNodeType.Element, "add", "");
 
             // add the proper attributes
-            newNode.SetAttribute("name", "MySqlRoleProvider");
+            newNode.SetAttribute("name", "MySQLRoleProvider");
 
             // add the type attribute by reflecting on the executing assembly
             Assembly a = Assembly.GetExecutingAssembly();
-            string type = String.Format("MySql.Web.Security.MySqlRoleProvider, {0}", a.FullName);
+            string type = String.Format("MySql.Web.Security.MySQLRoleProvider, {0}", a.FullName);
             newNode.SetAttribute("type", type);
 
             newNode.SetAttribute("connectionStringName", "LocalMySqlServer");
@@ -263,7 +263,7 @@
             foreach (XmlNode node in providersNode.ChildNodes)
             {
                 string name = node.Attributes["name"].Value;
-                if (name == "MySqlMembershipProvider")
+                if (name == "MySQLMembershipProvider")
                 {
                     providersNode.RemoveChild(node);
                     break;
@@ -278,7 +278,7 @@
             foreach (XmlNode node in providersNode.ChildNodes)
             {
                 string name = node.Attributes["name"].Value;
-                if (name == "MySqlRoleProvider")
+                if (name == "MySQLRoleProvider")
                 {
                     providersNode.RemoveChild(node);
                     break;

Modified: trunk/MySql.Web/Source/MembershipProvider.cs
===================================================================
--- trunk/MySql.Web/Source/MembershipProvider.cs	2007-05-23 19:44:46 UTC (rev 738)
+++ trunk/MySql.Web/Source/MembershipProvider.cs	2007-05-24 21:44:55 UTC (rev 739)
@@ -37,7 +37,7 @@
 
 namespace MySql.Web.Security
 {
-    public sealed class MySqlMembershipProvider : MembershipProvider
+    public sealed class MySQLMembershipProvider : MembershipProvider
     {
         private int newPasswordLength = 8;
         private string eventSource = "MySQLMembershipProvider";
@@ -80,6 +80,7 @@
                 config.Add("description", "MySQL Membership provider");
             }
             base.Initialize(name, config);
+
             pApplicationName = GetConfigValue(config["applicationName"], HostingEnvironment.ApplicationVirtualPath);
             pMaxInvalidPasswordAttempts = Convert.ToInt32(GetConfigValue(config["maxInvalidPasswordAttempts"], "5"));
             pPasswordAttemptWindow = Convert.ToInt32(GetConfigValue(config["passwordAttemptWindow"], "10"));
@@ -114,13 +115,14 @@
             {
                 throw new ProviderException("Password format not supported.");
             }
+
             ConnectionStringSettings ConnectionStringSettings = ConfigurationManager.ConnectionStrings[
                 config["connectionStringName"]];
-            if (ConnectionStringSettings == null || ConnectionStringSettings.ConnectionString.Trim() == "")
-            {
-                throw new ProviderException("Connection string cannot be blank.");
-            }
-            connectionString = ConnectionStringSettings.ConnectionString;
+            if (ConnectionStringSettings != null)
+                connectionString = ConnectionStringSettings.ConnectionString.Trim();
+            else
+                connectionString = "";
+
             Configuration cfg = WebConfigurationManager.OpenWebConfiguration(HostingEnvironment.ApplicationVirtualPath);
             machineKey = ((MachineKeySection) (cfg.GetSection("system.web/machineKey")));
             if (machineKey.ValidationKey == "AutoGenerate")
@@ -134,11 +136,11 @@
 
             // make sure our schema is up to date
             string autoGenSchema = config["AutoGenerateSchema"];
-            if (String.IsNullOrEmpty(autoGenSchema) || Convert.ToBoolean(autoGenSchema))
+            if ((String.IsNullOrEmpty(autoGenSchema) || Convert.ToBoolean(autoGenSchema)) && 
+                connectionString != String.Empty)
                 MembershipSchema.CheckSchema(connectionString);
         }
 
-
         private static string GetConfigValue(string configValue, string defaultValue)
         {
             if (string.IsNullOrEmpty(configValue))
@@ -426,9 +428,9 @@
         public override MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords)
         {
             MySqlConnection conn = new MySqlConnection(connectionString);
-            MySqlCommand cmd =
-                new MySqlCommand("SELECT Count(*) FROM mysql_Membership " + "WHERE ApplicationName = ?ApplicationName",
-                                 conn);
+            MySqlCommand cmd = new MySqlCommand(@"SELECT Count(*) FROM mysql_Membership 
+                WHERE ApplicationName = ?ApplicationName", conn);
+
             cmd.Parameters.Add("?ApplicationName", MySqlDbType.VarChar, 255).Value = pApplicationName;
             MembershipUserCollection users = new MembershipUserCollection();
             MySqlDataReader reader = null;
@@ -446,6 +448,8 @@
                                   " LastActivityDate, LastPasswordChangedDate, LastLockedOutDate " +
                                   " FROM mysql_Membership " + " WHERE ApplicationName = ?ApplicationName " +
                                   " ORDER BY Username Asc";
+
+                cmd.Parameters.Clear();
                 cmd.Parameters.Add("?ApplicationName", MySqlDbType.VarChar, 255).Value = pApplicationName.ToString();
                 reader = cmd.ExecuteReader();
                 int counter = 0;

Modified: trunk/MySql.Web/Source/RoleProvider.cs
===================================================================
--- trunk/MySql.Web/Source/RoleProvider.cs	2007-05-23 19:44:46 UTC (rev 738)
+++ trunk/MySql.Web/Source/RoleProvider.cs	2007-05-24 21:44:55 UTC (rev 739)
@@ -33,7 +33,7 @@
 
 namespace MySql.Web.Security
 {
-    public sealed class MySqlRoleProvider : RoleProvider
+    public sealed class MySQLRoleProvider : RoleProvider
     {
         private string eventSource = "MySQLRoleProvider";
         private string eventLog = "Application";
@@ -81,16 +81,15 @@
                 }
             }
             pConnectionStringSettings = ConfigurationManager.ConnectionStrings[config["connectionStringName"]];
-            if (pConnectionStringSettings == null || pConnectionStringSettings.ConnectionString.Trim() == "")
-            {
-                throw new ProviderException("Connection string cannot be blank.");
-            }
-            connectionString = pConnectionStringSettings.ConnectionString;
+            if (pConnectionStringSettings != null)
+                connectionString = pConnectionStringSettings.ConnectionString.Trim();
+            else
+                connectionString = "";
 
-
             // make sure our schema is up to date
             string autoGenSchema = config["AutoGenerateSchema"];
-            if (String.IsNullOrEmpty(autoGenSchema) || Convert.ToBoolean(autoGenSchema))
+            if ((String.IsNullOrEmpty(autoGenSchema) || Convert.ToBoolean(autoGenSchema)) &&
+                connectionString != String.Empty)
                 RoleSchema.CheckSchema(connectionString);
         }
 

Thread
Connector/NET commit: r739 - in trunk: . MySql.Web/Sourcerburnett24 May