Added ability to customize db, user suffixes on Init
This commit is contained in:
@@ -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 @@
|
||||
<h2>Create the database and users</h2>
|
||||
<p>The Swarmops install sequence can set up the database and users for you, if you provide a root password to the MySQL database server.</p>
|
||||
<p>(If you don't trust the Swarmops install to do that, that's fine, go to <a href="javascript:goManualCredentials();">manual account credentials</a>.)</p>
|
||||
<div class="entryLabelsAdmin" style="width:250px">Hostname of MySQL database server<br/>Root password for that MySQL server<br/> </div>
|
||||
<div class="entryFieldsAdmin"><input type="text" id="TextMysqlServerHost" value="localhost"/> <br/><input type="password" id="TextMysqlRootPassword"/> </div>
|
||||
<div class="entryLabelsAdmin" style="width:250px">Hostname of MySQL database server<br/>Root password for that MySQL server<br/>Random label (suffixed to db, user names)<br/> </div>
|
||||
<div class="entryFieldsAdmin"><input type="text" id="TextMysqlServerHost" value="localhost"/> <br/><input type="password" id="TextMysqlRootPassword"/> <br/><asp:TextBox runat="server" ID="TextRandomDbLabel" /> </div>
|
||||
</div>
|
||||
<div id="DivDatabaseManualConfig" style="display:none">
|
||||
<h2>Connect to existing database</h2>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user