summaryrefslogtreecommitdiffstats
path: root/application/service/files.php
AgeCommit message (Collapse)AuthorFilesLines
2019-01-28WIP: Add preview of text pastes to historydev-text-paste-previewFlorian Pritz1-0/+23
- Performance needs to be improved by putting the preview text into the database instead of fetching it on each call. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-07-18Use transaction when adding fileFlorian Pritz1-0/+2
This helps when the upload_path is not writable. Without the transaction we get stale records in the db that then cause errors because the file can't be found. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-06-01service/files: Add missing namespace for Recursive*IteratorFlorian Pritz1-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-05-03Move cleanup code from controller to \service\filesFlorian Pritz1-0/+98
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-01-01Ensure file does not exist when new one is added to DBFlorian Pritz1-0/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-01-01Only update mtime when uploaded files already existFlorian Pritz1-6/+17
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-11-05Remove API v1 compatability codeFlorian Pritz1-2/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-09-19Extract tooltip function into \service\filesFlorian Pritz1-0/+28
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-08-21mfile->add_file: Take userid via argumentFlorian Pritz1-6/+6
This allows for easier testing. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-07-13Remove incorrect TODO about $new_file being unsetFlorian Pritz1-1/+0
I think this is left over from developing the feature. This seems to have been incorrect in the inital commit of the code. Just drop it. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-07-04service\files->get_multipaste_history: Add sort order from DBFlorian Pritz1-1/+8
Keep this field private for now. I may be exposed at a later time. The returned values are already normalized so they can be safely exposed. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-07-04Add function to ellipsize textFlorian Pritz1-0/+38
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-06-16Remove old TODOFlorian Pritz1-1/+0
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-09-20postgres: Fix multiple queries using MySQL syntaxFlorian Pritz1-5/+5
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-09-20API 2.1: Add thumbnail link to historyFlorian Pritz1-0/+3
Also adjust test cases to check for the new value. API v1 does not change. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-09-14API 2.0: Remove private fields from file/historyFlorian Pritz1-1/+6
Since this is a breaking change bump the api version to 2. The private fields are user_id and multipaste_id which where leaked via the multipaste_items field. This commit also adds a test case to both api versions that checks the returned fields. NOTE: Most of this commit is copied from the files of api v1 so when viewing the diff use --find-copies-harder for an easy to read diff. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-05-21Calc correct total size for history with duplicate hashesFlorian Pritz1-1/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-05-21Support multiple files with the same hashFlorian Pritz1-33/+52
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-04-18s/files:get_multipaste_history: Remove multipastes without itemsFlorian Pritz1-0/+8
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-03-08api/file/create_multipase: return URLFlorian Pritz1-0/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-03-08Unify file/cron and mfile->valid_idFlorian Pritz1-0/+50
Create a testable function doing all the verification/removal, add tests and use it for both cases. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-22s\files: rename add_file to add_uploaded_fileFlorian Pritz1-1/+1
It doesn't add any file so it should have that name. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-21s/files: add add_file_data for future code deduplicationFlorian Pritz1-2/+31
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-15s/file/add_file: make file move atomicFlorian Pritz1-3/+5
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-14Fix consistency of error_idsFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-14Use assoc array for service/files/verify_uploaded_filesFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-06service/files::delete: Fix incorrect error when wrong ownerFlorian Pritz1-3/+4
Also improve the variable name for easier understanding. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-05service/files::history: Fix total_size if no resultsFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-05fixup! Support database table prefixesFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-03api: implement file/create_multipasteFlorian Pritz1-0/+53
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-03api: implement file/deleteFlorian Pritz1-0/+62
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-03Rework error handling in upload validatorFlorian Pritz1-3/+5
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-16add some TODOsFlorian Pritz1-0/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-16fix multipaste in service/historyFlorian Pritz1-1/+5
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-16refactor service/file/historyFlorian Pritz1-24/+28
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-16Improve history api for multipastesFlorian Pritz1-11/+21
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-16first go at reworking; needs to be redesignedFlorian Pritz1-0/+116
Signed-off-by: Florian Pritz <bluewind@xinu.at>