stable

Clone or download

Read-only

Use files size as a quota instead of number of files

This is part of story #8762: add attachment in modal - The existing limit (5) on total temporary files is removed - Instead, a new limit is added: a given user has a total file size quota that is the sum of all her temporary files' sizes. E.g. with a limit of 64 MB, if userA already has uploaded File1 of 33MB, userA can upload File2 of 16 MB but cannot upload File3 of 32 MB. - Related REST routes now send two additional custom headers: X-QUOTA and X-DISK-USAGE. X-QUOTA is defined at platform level (sys_max_size_upload in local.inc) and X-DISK-USAGE is the total size of temporary files of the current user. Change-Id: Icecd2617adf14cf409b981974efbce2e0cda6a29

Modified Files

Name
M plugins/tests/include/TestsPluginRunner.class.php +9 −5 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactFilesResource.class.php +1 −1 Go to diff View file
M plugins/tracker/include/REST/v1/ArtifactTemporaryFilesResource.class.php +51 −43 Go to diff View file
R plugins/tracker/include/Tracker/Artifact/Attachment/MaxFilesException.php Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Attachment/TemporaryFileManager.class.php +42 −29 Go to diff View file
D plugins/tracker/include/Tracker/Artifact/Attachment/TemporaryFileTooBigException.php +0 −22 Go to diff View file
M plugins/tracker/include/autoload.php +3 −4 Go to diff View file
A plugins/tracker/tests/Artifact/Attachment/TemporaryFileManagerTest.php +174 −0 Go to diff View file
M src/common/REST/Header.class.php +10 −0 Go to diff View file