diff --git a/Database/Database-Initialization.cs b/Database/Database-Initialization.cs index f5cac109..19b06ab8 100644 --- a/Database/Database-Initialization.cs +++ b/Database/Database-Initialization.cs @@ -8,7 +8,7 @@ namespace Swarmops.Database { // These functions are bloody dangerous, mmmkay? - public void ExecuteAdminCommand (string sqlSequence) + public void ExecuteAdminCommand(string sql) { // TODO: Verify that we're in admin mode @@ -16,14 +16,31 @@ namespace Swarmops.Database { connection.Open(); - DbCommand command = GetDbCommand (sqlSequence, connection); + DbCommand command = GetDbCommand(sql, connection); command.CommandType = CommandType.Text; command.ExecuteNonQuery(); } } - public int ExecuteAdminCommandScalar (string sqlSequence) + public void ExecuteAdminCommands(string[] sqlSequence) + { + // TODO: Verify that we're in admin mode + + using (DbConnection connection = GetMySqlDbConnection()) + { + connection.Open(); + + foreach (string sql in sqlSequence) + { + DbCommand command = GetDbCommand (sql, connection); + command.CommandType = CommandType.Text; + command.ExecuteNonQuery(); + } + } + } + + public int ExecuteAdminCommandScalar(string sqlSequence) { // TODO: Verify that we're in admin mode diff --git a/Logic/Structure/GeographyUpdate.cs b/Logic/Structure/GeographyUpdate.cs index 96aa8c2a..e920df84 100644 --- a/Logic/Structure/GeographyUpdate.cs +++ b/Logic/Structure/GeographyUpdate.cs @@ -159,7 +159,7 @@ namespace Swarmops.Logic.Structure cityIdsUsedLookup[city.CityId] = false; // force non-use of invalid city } - if (cityIdsUsedLookup[city.CityId]) + if ((cityIdsUsedLookup.ContainsKey(city.CityId) && cityIdsUsedLookup[city.CityId]) || country.PostalCodeLength == 0) { int newGeographyId = geographyIdTranslation[city.GeographyId]; diff --git a/Site5/Automation/Json-SearchPeoplePattern.aspx.cs b/Site5/Automation/Json-SearchPeoplePattern.aspx.cs index f9442018..dba214e5 100644 --- a/Site5/Automation/Json-SearchPeoplePattern.aspx.cs +++ b/Site5/Automation/Json-SearchPeoplePattern.aspx.cs @@ -22,6 +22,8 @@ namespace Swarmops.Frontend.Automation matches = new People(); } + // TODO: Add filter so the people must have active memberships of this org or any org below it (fixes #1) + if (matches.Count > 10) { matches.RemoveRange (10, matches.Count - 10); diff --git a/Site5/Controls/v5/Financial/CurrencyTextBox.ascx.cs b/Site5/Controls/v5/Financial/CurrencyTextBox.ascx.cs index c9d88ac7..907d65ee 100644 --- a/Site5/Controls/v5/Financial/CurrencyTextBox.ascx.cs +++ b/Site5/Controls/v5/Financial/CurrencyTextBox.ascx.cs @@ -41,5 +41,10 @@ namespace Swarmops.Frontend.Controls.v5.Financial } // TODO: Add other-currency parsing + + public new void Focus() + { + this.Input.Focus(); + } } } \ No newline at end of file diff --git a/Site5/Pages/v5/Admin/EditOrganization.aspx b/Site5/Pages/v5/Admin/EditOrganization.aspx index 48d057e3..21cc47c8 100644 --- a/Site5/Pages/v5/Admin/EditOrganization.aspx +++ b/Site5/Pages/v5/Admin/EditOrganization.aspx @@ -26,7 +26,7 @@ $.ajax({ type: "POST", - url: "EditOrganization.aspx/SwitchToggled", + url: "/Pages/v5/Admin/EditOrganization.aspx/SwitchToggled", data: $.toJSON(jsonData), contentType: "application/json; charset=utf-8", dataType: "json", @@ -54,7 +54,7 @@ $.ajax({ type: "POST", - url: "EditOrganization.aspx/GetInitialData", + url: "/Pages/v5/Admin/EditOrganization.aspx/GetInitialData", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", diff --git a/Site5/Pages/v5/Comms/SendMassMessage.aspx b/Site5/Pages/v5/Comms/SendMassMessage.aspx index 62abb38d..a4d686e8 100644 --- a/Site5/Pages/v5/Comms/SendMassMessage.aspx +++ b/Site5/Pages/v5/Comms/SendMassMessage.aspx @@ -20,7 +20,7 @@ function onGeographyChange(newGeographyId) { $.ajax({ type: "POST", - url: "SendMassMessage.aspx/GetRecipientCount", + url: "/Pages/v5/Comms/SendMassMessage.aspx/GetRecipientCount", data: "{'recipientTypeId': '" + $('#<%=this.DropRecipientClasses.ClientID %>').val() + "', 'geographyId':'" + newGeographyId + "'}", contentType: "application/json; charset=utf-8", dataType: "json", diff --git a/Site5/Pages/v5/Financial/AttestCosts.aspx b/Site5/Pages/v5/Financial/AttestCosts.aspx index e5ee5e69..b6380a62 100644 --- a/Site5/Pages/v5/Financial/AttestCosts.aspx +++ b/Site5/Pages/v5/Financial/AttestCosts.aspx @@ -65,7 +65,7 @@ var thisIcon = this; $.ajax({ type: "POST", - url: "AttestCosts.aspx/Attest", + url: "/Pages/v5/Financial/AttestCosts.aspx/Attest", data: "{'identifier': '" + escape($(this).attr("baseid")) + "'}", contentType: "application/json; charset=utf-8", dataType: "json", @@ -87,7 +87,7 @@ var thisIcon = this; $.ajax({ type: "POST", - url: "AttestCosts.aspx/Deattest", + url: "/Pages/v5/Financial/AttestCosts.aspx/Deattest", data: "{'identifier': '" + escape($(this).attr("baseid")) + "'}", contentType: "application/json; charset=utf-8", dataType: "json", diff --git a/Site5/Pages/v5/Financial/CreateInboundInvoice.aspx b/Site5/Pages/v5/Financial/CreateInboundInvoice.aspx index 2865a7a0..70453cbd 100644 --- a/Site5/Pages/v5/Financial/CreateInboundInvoice.aspx +++ b/Site5/Pages/v5/Financial/CreateInboundInvoice.aspx @@ -1,6 +1,7 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="CreateInboundInvoice.aspx.cs" Inherits="Swarmops.Frontend.Pages.v5.Financial.CreateInboundInvoice" %> <%@ Register src="~/Controls/v5/Base/FileUpload.ascx" tagname="FileUpload" tagprefix="Swarmops5" %> <%@ Register TagPrefix="Swarmops5" TagName="ComboBudgets" Src="~/Controls/v5/Financial/ComboBudgets.ascx" %> +<%@ Register TagPrefix="Swarmops5" TagName="CurrencyAmount" Src="~/Controls/v5/Financial/CurrencyTextBox.ascx" %> @@ -53,7 +54,7 @@ isValid = validateTextField('#<%=this.TextPurpose.ClientID %>', "") && isValid; var jsonData = {}; - jsonData.amount = $('#<%=this.TextAmount.ClientID %>').val(); + jsonData.amount = $('#<%=this.CurrencyAmount.ClientID %>_Input').val(); $.ajax({ type: "POST", @@ -65,9 +66,9 @@ success: function(msg) { if (msg.d != true) { isValid = false; - $('#TextAmount').addClass("entryError"); + $('#<%=CurrencyAmount.ClientID %>_Input').addClass("entryError"); alertify.error(""); - $('#<%=this.TextAmount.ClientID %>').focus(); + $('#<%=CurrencyAmount.ClientID %>_Input').focus(); } } }); @@ -114,7 +115,7 @@
​
- ​
+ ​
​
​
 
diff --git a/Site5/Pages/v5/Financial/CreateInboundInvoice.aspx.cs b/Site5/Pages/v5/Financial/CreateInboundInvoice.aspx.cs index dcaf0a67..e7fbd090 100644 --- a/Site5/Pages/v5/Financial/CreateInboundInvoice.aspx.cs +++ b/Site5/Pages/v5/Financial/CreateInboundInvoice.aspx.cs @@ -96,7 +96,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial { // Prime bank details - this.TextAmount.Text = 0.ToString ("N2"); + this.CurrencyAmount.Value = 0; this.TextSupplier.Focus(); this.TextDueDate.Text = DateTime.Today.AddDays (30).ToShortDateString(); // Use current culture @@ -137,9 +137,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial // The data has been validated client-side already. We'll throw unfriendly exceptions if invalid data is passed here. // People who choose to disable JavaScript and then submit bad input almost deserve to be hurt. - double amount = Double.Parse (this.TextAmount.Text, NumberStyles.Number); - // parses in current culture - intentional - Int64 amountCents = (Int64) (amount*100); + Int64 amountCents = (Int64) (this.CurrencyAmount.Value*100.0); string description = this.TextPurpose.Text; @@ -200,7 +198,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial this.TextAccount.Text = String.Empty; this.TextPurpose.Text = String.Empty; this.TextReference.Text = String.Empty; - this.TextAmount.Text = 0.ToString ("N2"); + this.CurrencyAmount.Value = 0; this.TextDueDate.Text = DateTime.Today.AddDays (30).ToShortDateString(); // Use current culture // the easyUI combo fields should reset automatically on form submission unless we explicitly reconstruct diff --git a/Site5/Pages/v5/Financial/FileExpenseClaim.aspx b/Site5/Pages/v5/Financial/FileExpenseClaim.aspx index 942bb8a2..2365e1d0 100644 --- a/Site5/Pages/v5/Financial/FileExpenseClaim.aspx +++ b/Site5/Pages/v5/Financial/FileExpenseClaim.aspx @@ -1,6 +1,7 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="FileExpenseClaim.aspx.cs" Inherits="Swarmops.Frontend.Pages.v5.Financial.FileExpenseClaim" %> <%@ Register src="~/Controls/v5/Base/FileUpload.ascx" tagname="FileUpload" tagprefix="Swarmops5" %> <%@ Register TagPrefix="Swarmops5" TagName="ComboBudgets" Src="~/Controls/v5/Financial/ComboBudgets.ascx" %> +<%@ Register TagPrefix="Swarmops5" TagName="CurrencyAmount" Src="~/Controls/v5/Financial/CurrencyTextBox.ascx" %> @@ -50,7 +51,7 @@ isValid = validateTextField('#<%=this.TextPurpose.ClientID %>', "") && isValid; var jsonData = {}; - jsonData.amount = $('#<%=this.TextAmount.ClientID %>').val(); + jsonData.amount = $('#<%=this.CurrencyAmount.ClientID %>_Input').val(); $.ajax({ type: "POST", @@ -62,9 +63,9 @@ success: function (msg) { if (msg.d != true) { isValid = false; - $('#TextAmount').addClass("entryError"); + $('#<%=this.CurrencyAmount.ClientID %>_Input').addClass("entryError"); alertify.error(""); - $('#<%=this.TextAmount.ClientID %>').focus(); + $('#<%=this.CurrencyAmount.ClientID %>_Input').focus(); } } }); @@ -107,7 +108,7 @@

- ​
+ ​
​
 
"> 
diff --git a/Site5/Pages/v5/Financial/FileExpenseClaim.aspx.cs b/Site5/Pages/v5/Financial/FileExpenseClaim.aspx.cs index c377d7b0..e52e0954 100644 --- a/Site5/Pages/v5/Financial/FileExpenseClaim.aspx.cs +++ b/Site5/Pages/v5/Financial/FileExpenseClaim.aspx.cs @@ -104,8 +104,8 @@ namespace Swarmops.Frontend.Pages.v5.Financial this.TextBank.Text = CurrentUser.BankName; this.TextClearing.Text = CurrentUser.BankClearing; this.TextAccount.Text = CurrentUser.BankAccount; - this.TextAmount.Text = 0.ToString ("N2"); - this.TextAmount.Focus(); + this.CurrencyAmount.Value = 0; + this.CurrencyAmount.Focus(); Localize(); } @@ -144,9 +144,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial // The data has been validated client-side already. We'll throw unfriendly exceptions if invalid data is passed here. // People who choose to disable JavaScript and then submit bad input almost deserve to be hurt. - double amount = Double.Parse (this.TextAmount.Text, NumberStyles.Number); - // parses in current culture - intentional - Int64 amountCents = (Int64) (amount*100.0); + Int64 amountCents = (Int64) (this.CurrencyAmount.Value*100.0); string description = this.TextPurpose.Text; diff --git a/Site5/Pages/v5/Financial/PayOutMoney.aspx b/Site5/Pages/v5/Financial/PayOutMoney.aspx index 7fcf8f66..06623554 100644 --- a/Site5/Pages/v5/Financial/PayOutMoney.aspx +++ b/Site5/Pages/v5/Financial/PayOutMoney.aspx @@ -60,7 +60,7 @@ var thisIcon = this; $.ajax({ type: "POST", - url: "PayOutMoney.aspx/ConfirmPayout", + url: "/Pages/v5/Financial/PayOutMoney.aspx/ConfirmPayout", data: "{'protoIdentity': '" + escape($(this).attr("baseid")) + "'}", contentType: "application/json; charset=utf-8", dataType: "json", @@ -84,7 +84,7 @@ $(this).attr("src", "/Images/Abstract/ajaxloader-medium.gif"); $.ajax({ type: "POST", - url: "PayOutMoney.aspx/UndoPayout", + url: "/Pages/v5/Financial/PayOutMoney.aspx/UndoPayout", data: "{'databaseId': '" + $("#IconApproval" + $(thisIcon).attr("baseid").replace(/\|/g, '')).attr("databaseid") + "'}", contentType: "application/json; charset=utf-8", dataType: "json", diff --git a/Site5/Pages/v5/Financial/ValidateReceipts.aspx b/Site5/Pages/v5/Financial/ValidateReceipts.aspx index cfeba567..49392c3f 100644 --- a/Site5/Pages/v5/Financial/ValidateReceipts.aspx +++ b/Site5/Pages/v5/Financial/ValidateReceipts.aspx @@ -65,7 +65,7 @@ var thisIcon = this; $.ajax({ type: "POST", - url: "ValidateReceipts.aspx/Validate", + url: "/Pages/v5/Financial/ValidateReceipts.aspx/Validate", data: "{'identifier': '" + escape($(this).attr("baseid")) + "'}", contentType: "application/json; charset=utf-8", dataType: "json", @@ -87,7 +87,7 @@ var thisIcon = this; $.ajax({ type: "POST", - url: "ValidateReceipts.aspx/Devalidate", + url: "/Pages/v5/Financial/ValidateReceipts.aspx/Devalidate", data: "{'identifier': '" + escape($(this).attr("baseid")) + "'}", contentType: "application/json; charset=utf-8", dataType: "json", diff --git a/Site5/Pages/v5/Init/Default.aspx b/Site5/Pages/v5/Init/Default.aspx index 837535e6..e1de1896 100644 --- a/Site5/Pages/v5/Init/Default.aspx +++ b/Site5/Pages/v5/Init/Default.aspx @@ -10,6 +10,7 @@ + @@ -104,7 +105,7 @@ if (hostName && hostName.length > 0 && hostAddress && hostAddress.length > 0) { $.ajax({ type: "POST", - url: "Default.aspx/VerifyHostNameAndAddress", + url: "/Pages/v5/Init/Default.aspx/VerifyHostNameAndAddress", data: "{'name': '" + escape(hostName) + "', 'address': '" + escape(hostAddress) + "'}", contentType: "application/json; charset=utf-8", dataType: "json", @@ -129,7 +130,7 @@ if (isValid) { // Validate writability of config file $.ajax({ type: "POST", - url: "Default.aspx/IsConfigurationFileWritable", + url: "/Pages/v5/Init/Default.aspx/IsConfigurationFileWritable", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", @@ -139,8 +140,9 @@ // Yes, config is writable. Hide "unwritable" div, show "writable" div, all is nice $('#DivDatabaseUnwritable').css('display', 'none'); - $('#DivDatabaseWritable').css('display', 'inline'); - $('#<%=this.TextCredentialsReadDatabase.ClientID %>').focus(); + $('#DivDatabaseRootConfig').css('display', 'inline'); + setTimeout('$("#TextMysqlServerHost").focus();', 250); + //$('#<%=this.TextCredentialsReadDatabase.ClientID %>').focus(); } else { // Config is NOT writable. Keep the error on-screen and keep re-checking every two seconds. @@ -155,9 +157,17 @@ else if (stepNumber == 2) { isValid = true; // assume true, make false as we go - textBoxes = ["<%=this.TextCredentialsReadDatabase.ClientID %>", "<%=this.TextCredentialsReadServer.ClientID %>", "<%=this.TextCredentialsReadUser.ClientID %>", "<%=this.TextCredentialsReadPassword.ClientID %>", - "<%=this.TextCredentialsWriteDatabase.ClientID %>", "<%=this.TextCredentialsWriteServer.ClientID %>", "<%=this.TextCredentialsWriteUser.ClientID %>", "<%=this.TextCredentialsWritePassword.ClientID %>", - "<%=this.TextCredentialsAdminDatabase.ClientID %>", "<%=this.TextCredentialsAdminServer.ClientID %>", "<%=this.TextCredentialsAdminUser.ClientID %>", "<%=this.TextCredentialsAdminPassword.ClientID %>"]; + textBoxes = []; + + if (autoConfigMode) { + textBoxes = ["TextMysqlServerHost", "TextMysqlRootPassword"]; + } else { + textBoxes = [ + "<%=this.TextCredentialsReadDatabase.ClientID %>", "<%=this.TextCredentialsReadServer.ClientID %>", "<%=this.TextCredentialsReadUser.ClientID %>", "<%=this.TextCredentialsReadPassword.ClientID %>", + "<%=this.TextCredentialsWriteDatabase.ClientID %>", "<%=this.TextCredentialsWriteServer.ClientID %>", "<%=this.TextCredentialsWriteUser.ClientID %>", "<%=this.TextCredentialsWritePassword.ClientID %>", + "<%=this.TextCredentialsAdminDatabase.ClientID %>", "<%=this.TextCredentialsAdminServer.ClientID %>", "<%=this.TextCredentialsAdminUser.ClientID %>", "<%=this.TextCredentialsAdminPassword.ClientID %>" + ]; + } for (loop = 0; loop < textBoxes.length; loop++) { fieldContents = $('#' + textBoxes[loop]).val(); @@ -174,42 +184,73 @@ if (isValid) { DisableNext(); // block Next during synchro call - it may take a while - // also, won't get re-enabled no matter the outcome - $.ajax({ - type: "POST", - url: "Default.aspx/FirstCredentialsTest", - data: "{" + - "'readDatabase':'" + $('#<%=this.TextCredentialsReadDatabase.ClientID %>').val() + "',"+ - "'readServer':'" + $('#<%=this.TextCredentialsReadServer.ClientID %>').val() + "',"+ - "'readUser':'" + $('#<%=this.TextCredentialsReadUser.ClientID %>').val() + "',"+ - "'readPassword':'" + $('#<%=this.TextCredentialsReadPassword.ClientID %>').val() + "',"+ - "'writeDatabase':'" + $('#<%=this.TextCredentialsWriteDatabase.ClientID %>').val() + "',"+ - "'writeServer':'" + $('#<%=this.TextCredentialsWriteServer.ClientID %>').val() + "',"+ - "'writeUser':'" + $('#<%=this.TextCredentialsWriteUser.ClientID %>').val() + "',"+ - "'writePassword':'" + $('#<%=this.TextCredentialsWritePassword.ClientID %>').val() + "',"+ - "'adminDatabase':'" + $('#<%=this.TextCredentialsAdminDatabase.ClientID %>').val() + "',"+ - "'adminServer':'" + $('#<%=this.TextCredentialsAdminServer.ClientID %>').val() + "',"+ - "'adminUser':'" + $('#<%=this.TextCredentialsAdminUser.ClientID %>').val() + "',"+ - "'adminPassword':'" + $('#<%=this.TextCredentialsAdminPassword.ClientID %>').val() + "',"+ - "'serverName':'" + hostName + "'," + - "'ipAddress':'" + hostAddress +"'}", - contentType: "application/json; charset=utf-8", - dataType: "json", - async: false, // blocks until function returns - race conditions otherwise - success: function (msg) { - if (msg.d.AllPermissionsOk != true) { + // also, won't get re-enabled no matter the outcome - // We have a permissions problem. Block further progress and display the problem. - updatePermissionsAnalysisDisplay(msg.d); - $('#DivDatabaseWritable').fadeOut(400, 'swing', function() { $('#DivDatabasePermissionProblem').fadeIn(200); }); - setTimeout('recheckDatabasePermissionsAnalysis();', 5000); // 5s until first re-check - isValid = false; - } else { - // re-enable Next only on exit of step 3 + var jsonData = {}; + jsonData.serverName = hostName; + jsonData.ipAddress = hostAddress; + + if (autoConfigMode) { + jsonData.mysqlHostName = $('#TextMysqlServerHost').val(); + jsonData.rootPassword = $('#TextMysqlRootPassword').val(); + + $.ajax({ + type: "POST", + url: "/Pages/v5/Init/Default.aspx/CreateDatabaseFromRoot", + data: $.toJSON(jsonData), + contentType: "application/json; charset=utf-8", + dataType: "json", + async: false, // blocks until function returns - race conditions otherwise + success: function (msg) { + if (msg.d != true) { + + // Credentials problem. + $('#TextMysqlRootPassword, #TextMysqlServerHost').css('background-image', "url('/Images/Icons/iconshock-cross-12px.png')").css('background-position', 'right center').css('background-repeat', 'no-repeat'); + EnableNext(); + isValid = false; + } else { + // re-enable Next only on exit of step 3 + } } - } - }); - } + }); + } + else + { + jsonData.readDatabase = $('#<%=this.TextCredentialsReadDatabase.ClientID %>').val(); + jsonData.readServer = $('#<%=this.TextCredentialsReadServer.ClientID %>').val(); + jsonData.readUser = $('#<%=this.TextCredentialsReadUser.ClientID %>').val(); + jsonData.readPassword = $('#<%=this.TextCredentialsReadPassword.ClientID %>').val(); + jsonData.writeDatabase = $('#<%=this.TextCredentialsWriteDatabase.ClientID %>').val(); + jsonData.writeServer = $('#<%=this.TextCredentialsWriteServer.ClientID %>').val(); + jsonData.writeUser = $('#<%=this.TextCredentialsWriteUser.ClientID %>').val(); + jsonData.writePassword = $('#<%=this.TextCredentialsWritePassword.ClientID %>').val(); + jsonData.adminDatabase = $('#<%=this.TextCredentialsAdminDatabase.ClientID %>').val(); + jsonData.adminServer = $('#<%=this.TextCredentialsAdminServer.ClientID %>').val(); + jsonData.adminUser = $('#<%=this.TextCredentialsAdminUser.ClientID %>').val(); + jsonData.adminPassword = $('#<%=this.TextCredentialsAdminPassword.ClientID %>').val(); + + $.ajax({ + type: "POST", + url: "/Pages/v5/Init/Default.aspx/FirstCredentialsTest", + data: $.toJSON(jsonData), + contentType: "application/json; charset=utf-8", + dataType: "json", + async: false, // blocks until function returns - race conditions otherwise + success: function(msg) { + if (msg.d.AllPermissionsOk != true) { + + // We have a permissions problem. Block further progress and display the problem. + updatePermissionsAnalysisDisplay(msg.d); + $('#DivDatabaseManualConfig').fadeOut(400, 'swing', function() { $('#DivDatabasePermissionProblem').fadeIn(200); }); + setTimeout('recheckDatabasePermissionsAnalysis();', 5000); // 5s until first re-check + isValid = false; + } else { + // re-enable Next only on exit of step 3 + } + } + }); + } + } if (isValid) { @@ -261,7 +302,7 @@ if (isValid) { $.ajax({ type: "POST", - url: "Default.aspx/CreateFirstUser", + url: "/Pages/v5/Init/Default.aspx/CreateFirstUser", data: "{'name': '" + escape($('#<%=this.TextFirstUserName.ClientID %>').val()) + "', 'mail': '" + escape($('#<%=this.TextFirstUserMail.ClientID %>').val()) + "', 'password': '" + escape($('#<%=this.TextFirstUserPassword1.ClientID %>').val()) + "'}", contentType: "application/json; charset=utf-8", dataType: "json", @@ -306,12 +347,12 @@ $.ajax({ type: "POST", - url: "Default.aspx/ResetTestCredentials", + url: "/Pages/v5/Init/Default.aspx/ResetTestCredentials", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { - $('#DivDatabasePermissionProblem').fadeOut(200, 'swing', function () { $('#DivDatabaseWritable').fadeIn(200); EnableNext(); }); + $('#DivDatabasePermissionProblem').fadeOut(200, 'swing', function () { $('#DivDatabaseManualConfig').fadeIn(200); EnableNext(); }); } }); } @@ -321,17 +362,17 @@ $.ajax({ type: "POST", - url: "Default.aspx/IsConfigurationFileWritable", + url: "/Pages/v5/Init/Default.aspx/IsConfigurationFileWritable", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { if (msg.d == true) { - // Yes, config is writable. Hide "unwritable" div, show "writable" div, all is nice + // Yes, config is writable. Hide "unwritable" div, show "config" div, all is nice $('#DivDatabaseUnwritable').css('display', 'none'); - $('#DivDatabaseWritable').fadeIn('slow'); - setTimeout('$("#<%=this.TextCredentialsReadDatabase.ClientID %>").focus();', 250); + $('#DivDatabaseManualConfig').fadeIn('slow'); + setTimeout('$("#TextMysqlServerHost").focus();', 250); EnableNext(); } else { // Config is NOT writable. Keep the error on-screen and keep re-checking every two seconds. @@ -346,7 +387,7 @@ $.ajax({ type: "POST", - url: "Default.aspx/GetInitProgress", + url: "/Pages/v5/Init/Default.aspx/GetInitProgress", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", @@ -381,7 +422,7 @@ $.ajax({ type: "POST", - url: "Default.aspx/GetInitProgressMessage", + url: "/Pages/v5/Init/Default.aspx/GetInitProgressMessage", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", @@ -411,7 +452,7 @@ $.ajax({ type: "POST", - url: "Default.aspx/RecheckDatabasePermissions", + url: "/Pages/v5/Init/Default.aspx/RecheckDatabasePermissions", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", @@ -462,7 +503,7 @@ function beginInitDatabase() { $.ajax({ type: "POST", - url: "Default.aspx/InitDatabase", + url: "/Pages/v5/Init/Default.aspx/InitDatabase", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", @@ -470,16 +511,24 @@ } }); - } + } + function goManualCredentials() { + autoConfigMode = false; + $('#DivDatabaseRootConfig').css('display', 'none'); + $('#DivDatabaseManualConfig').fadeIn('slow'); + setTimeout('$("#<%=this.TextCredentialsReadDatabase.ClientID %>").focus();', 250); + } + + var autoConfigMode = true;
-
|
| 
| 
-
Swarmops Logo
+
|
| 
| 
+
Swarmops Logo
@@ -582,8 +631,15 @@
-