Applicant should now be able to log in
This commit is contained in:
@@ -1076,6 +1076,19 @@ namespace Swarmops.Logic.Swarm
|
||||
return ParticipatesInOrganizationOrParent (org.Identity);
|
||||
}
|
||||
|
||||
|
||||
public bool ApplicantInOrganization(Organization org)
|
||||
{
|
||||
Applicants applicants = Applicants.FromArray(SwarmDb.GetDatabaseForReading().GetApplicants(this, org, DatabaseCondition.OpenTrue));
|
||||
if (applicants.Count > 0)
|
||||
{
|
||||
// There is at least one open application
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* --- not used, commented out for usage of hardcoded org ids
|
||||
public int NationalPartyOrg (bool onlyIfMember)
|
||||
{
|
||||
|
||||
+1
-1
@@ -180,7 +180,7 @@ namespace Resources.Pages {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to This is the organization-specific text shown for Signup Finalization. It is set in Admin / Org Settings. When the new person presses Finish, they will be entered into the organization, logged on, and sent to the Dashboard as a Beginner user.
|
||||
/// Looks up a localized string similar to This is the organization-specific text shown for Signup Finalization. It is set in Admin / Org Settings. When the new person presses Finish, they will be entered into the organization, logged on, and sent to the Dashboard as a Beginner user..
|
||||
/// </summary>
|
||||
internal static string Signup_DefaultLastPageText {
|
||||
get {
|
||||
|
||||
@@ -163,7 +163,7 @@ If you volunteered for taking formal responsibility, somebody (probably also a v
|
||||
<value>This is the organization's custom welcome text. It has not yet been written; it is set in Admin / Org Settings.</value>
|
||||
</data>
|
||||
<data name="Signup_DefaultLastPageText" xml:space="preserve">
|
||||
<value>This is the organization-specific text shown for Signup Finalization. It is set in Admin / Org Settings. When the new person presses Finish, they will be entered into the organization, logged on, and sent to the Dashboard as a Beginner user</value>
|
||||
<value>This is the organization-specific text shown for Signup Finalization. It is set in Admin / Org Settings. When the new person presses Finish, they will be entered into the organization, logged on, and sent to the Dashboard as a Beginner user.</value>
|
||||
</data>
|
||||
<data name="Signup_DefaultSidebarText" xml:space="preserve">
|
||||
<value>This is the organization's short sidebar info. It is set in Administration / Org Settings.</value>
|
||||
|
||||
@@ -301,7 +301,6 @@ namespace Swarmops.Frontend.Pages.Public
|
||||
|
||||
}
|
||||
|
||||
|
||||
// TODO: CREATE APPLICATION INSTEAD DEPENDING ON POLICY
|
||||
|
||||
// TODO: SEND NOTIFICATIONS
|
||||
@@ -336,7 +335,7 @@ namespace Swarmops.Frontend.Pages.Public
|
||||
|
||||
// Set authentication cookie, which will log the new person in using the credentials just given
|
||||
|
||||
FormsAuthentication.SetAuthCookie (Authority.FromLogin (newPerson).ToEncryptedXml(), true);
|
||||
FormsAuthentication.SetAuthCookie (Authority.FromLogin (newPerson, organization).ToEncryptedXml(), true);
|
||||
|
||||
AjaxCallResult result = new AjaxCallResult {Success = true};
|
||||
return result;
|
||||
|
||||
@@ -346,7 +346,7 @@ namespace Swarmops.Pages.Security
|
||||
Authority testAuthority = Authority.FromLogin (authenticatedPerson,
|
||||
Organization.FromIdentity (lastOrgId));
|
||||
|
||||
if (!authenticatedPerson.ParticipatesInOrganizationOrParent (lastOrgId) && !testAuthority.HasSystemAccess (AccessType.Read))
|
||||
if (!authenticatedPerson.ParticipatesInOrganizationOrParent (lastOrgId) && !authenticatedPerson.ApplicantInOrganization (lastOrgId) && !testAuthority.HasSystemAccess (AccessType.Read))
|
||||
{
|
||||
// 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)
|
||||
|
||||
Reference in New Issue
Block a user