diff --git a/Site5/Pages/v5/Public/Initialize.aspx b/Site5/Pages/v5/Public/Initialize.aspx
index 51e4e1d6..c84cf5a3 100644
--- a/Site5/Pages/v5/Public/Initialize.aspx
+++ b/Site5/Pages/v5/Public/Initialize.aspx
@@ -193,6 +193,7 @@
if (autoConfigMode) {
jsonData.mysqlHostName = $('#TextMysqlServerHost').val();
jsonData.rootPassword = $('#TextMysqlRootPassword').val();
+ jsonData.random = $('#<%= this.TextRandomDbLabel.ClientID%>').val();
$.ajax({
type: "POST",
@@ -632,8 +633,8 @@
Create the database and users
The Swarmops install sequence can set up the database and users for you, if you provide a root password to the MySQL database server.
(If you don't trust the Swarmops install to do that, that's fine, go to manual account credentials.)
- Hostname of MySQL database server
Root password for that MySQL server
-
+ Hostname of MySQL database server
Root password for that MySQL server
Random label (suffixed to db, user names)
+
Connect to existing database
diff --git a/Site5/Pages/v5/Public/Initialize.aspx.cs b/Site5/Pages/v5/Public/Initialize.aspx.cs
index 186590d2..8fefa4b2 100644
--- a/Site5/Pages/v5/Public/Initialize.aspx.cs
+++ b/Site5/Pages/v5/Public/Initialize.aspx.cs
@@ -66,6 +66,8 @@ namespace Swarmops.Frontend.Pages.v5.Public
// this.LanguageSelector.LanguageChanged += new EventHandler(LanguageSelector_LanguageChanged);
+ this.TextRandomDbLabel.Text = Authentication.CreateRandomPassword(5);
+
Localize();
}
@@ -95,7 +97,7 @@ namespace Swarmops.Frontend.Pages.v5.Public
[WebMethod]
public static bool CreateDatabaseFromRoot (string mysqlHostName, string rootPassword, string serverName,
- string ipAddress)
+ string ipAddress, string random)
{
if (!(VerifyHostName (serverName) && VerifyHostAddress (ipAddress)))
{
@@ -107,7 +109,12 @@ namespace Swarmops.Frontend.Pages.v5.Public
try
{
- string random = Authentication.CreateRandomPassword (5);
+ random = random.Trim();
+
+ if (string.IsNullOrEmpty (random))
+ {
+ random = Authentication.CreateRandomPassword (5);
+ }
SwarmDb.Credentials rootCredentials = new SwarmDb.Credentials ("mysql",
new SwarmDb.ServerSet (mysqlHostName), "root", rootPassword);