diff --git a/Site5/Security/Login.aspx.cs b/Site5/Security/Login.aspx.cs index a590f695..1a459a78 100644 --- a/Site5/Security/Login.aspx.cs +++ b/Site5/Security/Login.aspx.cs @@ -266,7 +266,12 @@ namespace Swarmops.Pages.Security int lastOrgId = authenticatedPerson.LastLogonOrganizationId; - if (lastOrgId == 0) + if (PilotInstallationIds.IsPilot (PilotInstallationIds.PiratePartySE) && (lastOrgId == 3 || lastOrgId == 0)) + { + lastOrgId = 1; // legacy: log on to Piratpartiet SE if indeterminate; prevent sandbox for this pilot + authenticatedPerson.LastLogonOrganizationId = 1; // avoid future legacy problems + } + else if (lastOrgId == 0) { lastOrgId = Organization.SandboxIdentity; } @@ -274,6 +279,12 @@ namespace Swarmops.Pages.Security if (!authenticatedPerson.MemberOfWithInherited (lastOrgId)) { // If the person doesn't have access to the last organization (anymore), log on to Sandbox + // unless first pilot, in which case throw (deny login) + + if (PilotInstallationIds.IsPilot (PilotInstallationIds.PiratePartySE)) + { + throw new UnauthorizedAccessException(); + } lastOrgId = Organization.SandboxIdentity; } diff --git a/VERSION b/VERSION index 1f911eaa..e95e44b7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.1.0-alpha07 +5.1.0-alpha07.1