Fix for legacy installations for new auth framework

This commit is contained in:
Rick Falkvinge
2015-04-20 13:26:43 +02:00
parent 8c272a99f8
commit ff1a935ad8
2 changed files with 13 additions and 2 deletions
+12 -1
View File
@@ -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;
}
+1 -1
View File
@@ -1 +1 @@
5.1.0-alpha07
5.1.0-alpha07.1