summaryrefslogtreecommitdiffstats
path: root/application/models
AgeCommit message (Collapse)AuthorFilesLines
2016-03-29Use PHP's password_hash functionFlorian Pritz1-5/+1
This drops a third party library, but bumps our required php version to 5.5 which is currently old stable. Earlier versions are no longer supported by php upstream nor by us. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-09-20postgres: Fix multiple queries using MySQL syntaxFlorian Pritz1-6/+6
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-08-18Fix redirect URI when using multiple tabsFlorian Pritz1-12/+0
If we store only the last called URI in the session we can't support multiple browser tabs that all need to log in again. Fix this by storing the URI in the URL. Also change a trim() to ltrim() so that the URI string we store keeps it's trailing slash. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-08-10Increase thumbnail cache ttlFlorian Pritz1-0/+1
Also try to clean up when files are deleted since 1 month is a rather long time. Granted, thumbnails are small, but whatever Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-08-09Improve performance of thumbnail historyFlorian Pritz1-12/+16
- Use the filedata we already have in c/file->upload_history_thumbnails() rather than fetching it per id in m/mfile->valid_id - Construct the config array for s/f::valid_id only once and not for every validation. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-05-21Support multiple files with the same hashFlorian Pritz1-45/+38
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-04-08Cache filedataFlorian Pritz1-12/+15
This brings down render time of a multipaste with 180 items from ~180ms to ~80ms. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-04-01Refactor lexer code into dedicated classFlorian Pritz1-183/+0
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-03-21Highlight application/postscriptFlorian Pritz1-0/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-03-19Make user/get_action/invalid-action exception publicFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-03-16Map .pp files to puppet lexerFlorian Pritz1-0/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-03-08Unify file/cron and mfile->valid_idFlorian Pritz1-25/+18
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-03-02Add imagemagick supportFlorian Pritz1-9/+1
Adds additional support for imagemagick if GD doesn't support a file type and extends the files displayed as thumbnails to all images and pdf files. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-19Add claiming of multipastesFlorian Pritz2-0/+13
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-06fixup! Support database table prefixesFlorian Pritz1-8/+8
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-05fixup! Support database table prefixesFlorian Pritz1-6/+6
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-03Use exceptions instead of show_errorFlorian Pritz3-5/+5
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-03use function instead of variableFlorian Pritz1-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-02-03generalize authentication handlingFlorian Pritz1-12/+10
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-11-08mfile->delete_id: Forgive if a dir doesn't existFlorian Pritz1-2/+4
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-11-03mfile->delete_id: Check for file before trying to unlinkFlorian Pritz1-1/+3
file->cron unlinks the file and then deletes the hash which causes an error in mfile->delete_id because the file no longer exists. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-11-03Simplify mfile->delete_hashFlorian Pritz1-31/+3
This probably increases the database queries a bit, but greatly simplifies the code and fixes the missing deletion of multipaste tarballs (delete_id handles that). Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-11-03Properly delete multipastes when deleting a single pasteFlorian Pritz1-4/+4
mmultipaste->delete_id() also deletes multipaste tarballs which would otherwise be left over Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-11-03Fix deletion of multipaste tarball when deleting a multipasteFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-11-02Add tarball support to multipastesFlorian Pritz1-0/+9
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-10-19Clean up the postgres changesFlorian Pritz1-6/+10
Style cleanup and some regression fixes Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-10-10Merge remote-tracking branch 'rafi/master' into rafiFlorian Pritz3-71/+77
2014-10-03Move thumbnail code to dedicated classFlorian Pritz1-172/+0
This also moves the code from mfile->image_dimension() to the only place where it was called. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-09-20thumbnails: Handle EXIF orientationFlorian Pritz1-0/+63
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-09-19Fixing multipaste delete queriesRafael Bodill2-38/+33
2014-09-19Fix user/register mistaken query handlingRafael Bodill1-1/+1
2014-09-19WIP: Cascading deleteRafael Bodill2-20/+40
2014-09-18Integrating query builder in modelsRafael Bodill2-51/+42
2014-09-11Fix black background in thumbnails with transparencyFlorian Pritz1-0/+6
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-08-29add multipaste supportFlorian Pritz2-32/+246
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-02-21Implement multiple access levels for api keysFlorian Pritz1-7/+12
This allows to use an api key to write a completly standalone client. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-01-21Disable automatic code display for SVG filesFlorian Pritz1-1/+0
People usually want to view them rather than read the code. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2014-01-10let GD itself determine what it can readFlorian Pritz1-14/+5
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-11-09use cache_function() everywhereFlorian Pritz1-6/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-22Add some more file extension -> lexer mappingsFlorian Pritz1-0/+18
Mimetype detection doesn't always properly detect code (I saw javascript as plain text, c as asm) and if there is an extension we can likely get better result by using that. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-16Remove executable bitsFlorian Pritz1-0/+0
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-15Add default get_email to Duser_DriverFlorian Pritz1-4/+0
This fixes a possible endless loop when the function is not implemented in the driver, but the array says it is. It also allows us to simply call it without checking if it's implemented. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-04Replace is_cli_client() with stateful_client where applicableFlorian Pritz1-2/+1
Stateless clients (cli client and clients using api keys) can't reclaim IDs (no cookie) so they should be required to log in asap and they will always get an error if they didn't log in. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-04Set login session data in one goFlorian Pritz1-4/+6
This reduces the amount of db queries and cookies we create since each update triggers an db update and (which is a bug) sets a new cookie. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-04Only renew uri flashdata when needed.Florian Pritz1-1/+1
This saves us 2 to 4 (useless) db queries per page. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-02mfile/delete_id: Remove require_access callFlorian Pritz1-1/+0
We expect the controller to take care of that, no need to double check. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-02muser: always verify api credentials; improve error messagesFlorian Pritz1-17/+18
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-08-22Add comment about ID blacklistFlorian Pritz1-0/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-08-15Switch to CI's caching classFlorian Pritz1-3/+3
This supports more caching backends and doesn't force users to install the memcache extension. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-08-13Coding style fixesFlorian Pritz1-4/+4
Signed-off-by: Florian Pritz <bluewind@xinu.at>