Disabled 'Data Upload' when no automation

This commit is contained in:
Rick Falkvinge
2014-11-06 01:30:01 +01:00
parent 2ab9b21c05
commit a5f3cd0e8a
@@ -4,6 +4,7 @@ using System.Globalization;
using System.IO;
using System.Text;
using System.Threading;
using System.Web;
using System.Web.Services;
using System.Web.UI.WebControls;
using Swarmops.Basic.Enums;
@@ -31,6 +32,28 @@ namespace Swarmops.Site.Pages.Ledgers
this.PageIcon = "iconshock-bank";
this.PageAccessRequired = new Access(this.CurrentOrganization, AccessAspect.Bookkeeping, AccessType.Write);
// HACK HACK: If not a supported hardcoded org, bail out like a chicken
// UGLY UGLY UGLY
bool supportedHardcode = false;
if (PilotInstallationIds.IsPilot(PilotInstallationIds.PiratePartySE) && CurrentOrganization.Identity == 1) // PPSE
{
supportedHardcode = true;
}
if (PilotInstallationIds.IsPilot(PilotInstallationIds.SwarmopsLive) && CurrentOrganization.Identity == 7) // EPA
{
supportedHardcode = true;
}
if (!supportedHardcode)
{
Response.AppendCookie(new HttpCookie("DashboardMessage", HttpUtility.UrlEncode("There are no asset accounts set up for automation, so no accounts support data upload at this time. Returning to Dashboard.")));
Response.Redirect("/", true);
}
if (!IsPostBack)
{
// Localize