Fixed validation bugs; added favicon.ico as configuration file to frontend

This commit is contained in:
Rick Falkvinge
2013-11-29 03:17:08 +00:00
parent aaeb02385e
commit 201b6eb25e
3 changed files with 19 additions and 4 deletions
@@ -1 +1,3 @@
/opt/swarmops/frontend/machineKey.config
/opt/swarmops/frontend/favicon.ico
@@ -197,7 +197,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial
private void PopulateExpenses()
{
ExpenseClaims expenses = ExpenseClaims.ForOrganization(this.CurrentOrganization).WhereUnattested;
ExpenseClaims expenses = ExpenseClaims.ForOrganization(this.CurrentOrganization).WhereUnvalidated;
foreach (var expenseClaim in expenses)
{
@@ -226,4 +226,4 @@ namespace Swarmops.Frontend.Pages.v5.Financial
public string Title { get; set; }
}
}
}
}
+15 -2
View File
@@ -45,7 +45,7 @@ namespace Swarmops.Pages.v5.Support
Document document = Document.FromIdentity(documentId);
//Orgid is needed to safely verify permission
int orgId = Organization.PPSEid;
int orgId = 0; // initialize to invalid
bool hasPermission = false;
@@ -87,6 +87,14 @@ namespace Swarmops.Pages.v5.Support
hasPermission = true;
break;
}
// TODO: Security leak - check CurrentOrganization against Document's org
if (this.CurrentUser.HasAccess (new Access(CurrentOrganization, AccessAspect.Financials, AccessType.Write)))
{
hasPermission = true;
break;
}
/*
if (this.CurrentAuthority.HasPermission(Permission.CanSeeEconomyDetails, orgId, -1, Authorization.Flag.ExactOrganization))
{
@@ -181,8 +189,13 @@ namespace Swarmops.Pages.v5.Support
// TODO: If still doesn't exist, perhaps return a friendly error image instead?
if (!File.Exists(StorageRoot + legacyMarker + document.ServerFileName))
{
throw new FileNotFoundException(StorageRoot + legacyMarker + document.ServerFileName);
}
Response.ContentType = contentType + "; filename=" + document.ClientFileName;
Response.TransmitFile(StorageRoot + legacyMarker + document.ServerFileName);
}
}
}
}