diff --git a/ProjectLighthouse/Controllers/PhotosController.cs b/ProjectLighthouse/Controllers/PhotosController.cs index 6d30d184..e96b7a2a 100644 --- a/ProjectLighthouse/Controllers/PhotosController.cs +++ b/ProjectLighthouse/Controllers/PhotosController.cs @@ -9,6 +9,7 @@ using Kettu; using LBPUnion.ProjectLighthouse.Logging; using LBPUnion.ProjectLighthouse.Serialization; using LBPUnion.ProjectLighthouse.Types; +using LBPUnion.ProjectLighthouse.Types.Settings; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -32,6 +33,8 @@ namespace LBPUnion.ProjectLighthouse.Controllers User? user = await this.database.UserFromGameRequest(this.Request); if (user == null) return this.StatusCode(403, ""); + if (user.PhotosByMe >= ServerSettings.Instance.PhotosQuota) return this.BadRequest(); + this.Request.Body.Position = 0; string bodyString = await new StreamReader(this.Request.Body).ReadToEndAsync(); diff --git a/ProjectLighthouse/Types/Settings/ServerSettings.cs b/ProjectLighthouse/Types/Settings/ServerSettings.cs index e4caf307..820c1a18 100644 --- a/ProjectLighthouse/Types/Settings/ServerSettings.cs +++ b/ProjectLighthouse/Types/Settings/ServerSettings.cs @@ -63,7 +63,7 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings } } - public const int CurrentConfigVersion = 11; // MUST BE INCREMENTED FOR EVERY CONFIG CHANGE! + public const int CurrentConfigVersion = 12; // MUST BE INCREMENTED FOR EVERY CONFIG CHANGE! #region Meta @@ -103,6 +103,8 @@ namespace LBPUnion.ProjectLighthouse.Types.Settings public int ListsQuota { get; set; } = 50; + public int PhotosQuota { get; set; } = 500; + public bool GoogleAnalyticsEnabled { get; set; } = false; public string GoogleAnalyticsId { get; set; } = "";