-
+
diff --git a/Site5/Pages/v5/Ledgers/AccountPlan.aspx.cs b/Site5/Pages/v5/Ledgers/AccountPlan.aspx.cs
index 67ec3d85..7a9240f7 100644
--- a/Site5/Pages/v5/Ledgers/AccountPlan.aspx.cs
+++ b/Site5/Pages/v5/Ledgers/AccountPlan.aspx.cs
@@ -27,6 +27,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
this.PageTitle = Resources.Pages.Ledgers.AccountPlan_PageTitle;
this.InfoBoxLiteral = Resources.Pages.Ledgers.AccountPlan_Info;
this.PageAccessRequired = new Access(this.CurrentOrganization, AccessAspect.Bookkeeping, AccessType.Write);
+ this.DbVersionRequired = 2; // Account reparenting
}
@@ -117,6 +118,27 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
return true;
}
+ [WebMethod]
+ public static bool SetAccountParent (int accountId, int parentAccountId)
+ {
+ AuthenticationData authData = GetAuthenticationDataAndCulture();
+ FinancialAccount account = FinancialAccount.FromIdentity(accountId);
+
+ if (!PrepareAccountChange(account, authData, true))
+ {
+ return false;
+ }
+
+ FinancialAccount newParent = FinancialAccount.FromIdentity(parentAccountId);
+ if (newParent.OrganizationId != authData.CurrentOrganization.Identity)
+ {
+ throw new ArgumentException("Parent account mismatches with organization identity");
+ }
+
+ account.Parent = newParent;
+ return true;
+ }
+
[WebMethod]
public static bool SetAccountOwner(int accountId, int newOwnerId)
{
@@ -128,7 +150,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
return false;
}
- // TODO: Verify that authdata.AuthenticatedPerson can see personId, or this can be exploited to enumerate all people
+ // TODO SECURITY: Verify that authdata.AuthenticatedPerson can see personId, or this can be exploited to enumerate all people
account.Owner = Person.FromIdentity(newOwnerId);
return true;
diff --git a/Site5/Pages/v5/Security/AccessDenied.aspx b/Site5/Pages/v5/Security/AccessDenied.aspx
index 0c638ffa..a696e4ca 100644
--- a/Site5/Pages/v5/Security/AccessDenied.aspx
+++ b/Site5/Pages/v5/Security/AccessDenied.aspx
@@ -13,12 +13,5 @@
-
-
-
diff --git a/Site5/Pages/v5/Security/AccessDenied.aspx.cs b/Site5/Pages/v5/Security/AccessDenied.aspx.cs
index 536b7d65..6ca6f026 100644
--- a/Site5/Pages/v5/Security/AccessDenied.aspx.cs
+++ b/Site5/Pages/v5/Security/AccessDenied.aspx.cs
@@ -12,8 +12,7 @@ public partial class Security_AccessDenied : PageV5Base
this.PageIcon = "iconshock-disconnect";
this.LabelAccessDeniedHeader.Text = Resources.Pages.Security.AccessDenied_Header;
- this.LabelSidebarInfo.Text = Resources.Global.Sidebar_Information;
- this.LabelAccessDeniedInfo.Text = Resources.Pages.Security.AccessDenied_Info;
+ this.InfoBoxLiteral = Resources.Pages.Security.AccessDenied_Info;
this.LiteralAccessDeniedRant.Text = String.Format(Resources.Pages.Security.AccessDenied_Rant, this.CurrentOrganization.Name);
}
}
\ No newline at end of file
diff --git a/Site5/Pages/v5/Security/DatabaseUpgradeRequired.aspx b/Site5/Pages/v5/Security/DatabaseUpgradeRequired.aspx
new file mode 100644
index 00000000..03d4cc24
--- /dev/null
+++ b/Site5/Pages/v5/Security/DatabaseUpgradeRequired.aspx
@@ -0,0 +1,13 @@
+<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="DatabaseUpgradeRequired.aspx.cs" Inherits="Security_DatabaseUpgradeRequired" %>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Site5/Pages/v5/Security/DatabaseUpgradeRequired.aspx.cs b/Site5/Pages/v5/Security/DatabaseUpgradeRequired.aspx.cs
new file mode 100644
index 00000000..164e8ac2
--- /dev/null
+++ b/Site5/Pages/v5/Security/DatabaseUpgradeRequired.aspx.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+public partial class Security_DatabaseUpgradeRequired : PageV5Base
+{
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ this.PageTitle = Resources.Pages.Security.DatabaseUpgradeRequired_PageTitle;
+ this.PageIcon = "iconshock-disconnect";
+
+ this.LabelDbUpgradeRequiredHeader.Text = Resources.Pages.Security.DatabaseUpgradeRequired_Header;
+ this.InfoBoxLiteral = Resources.Pages.Security.DatabaseUpgradeRequired_Info;
+ this.LiteralDbUpgradeRequiredRant.Text = Resources.Pages.Security.DatabaseUpgradeRequired_Rant;
+ }
+}
\ No newline at end of file