summaryrefslogtreecommitdiffstats
path: root/application/models
AgeCommit message (Collapse)AuthorFilesLines
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>
2013-08-11Remove api keys dependency on usernameFlorian Pritz1-5/+2
We don't need it and getting the user name from the user drivers is way more complicated. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-08-11Add API key supportFlorian Pritz2-10/+59
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-08-05Add history page with thumbnails of imagesFlorian Pritz1-0/+112
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-07-16Fix handling of upload_max_age = 0Florian Pritz1-0/+3
cron code already handled this correctly, valid() didn't. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-07-15Rework auto login for cli clientsFlorian Pritz1-32/+41
Only login when necessary. This also makes test_login() work properly (before the automatic login would have intercepted the failure and in case of a good login test_login() would test the credentials a second time. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-07-15user/test_login: Allow clients to test login credentialsFlorian Pritz1-0/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-07-14get_upload_id_limits(): return proper default valuesFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-07-13Add profile page to allow changing the upload id limitsFlorian Pritz1-0/+59
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-07-13duser: add get_email()Florian Pritz1-0/+9
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-07-07Add .coffee extension mappingFlorian Pritz1-0/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-06-27mfile: Add some more ocaml extension mappingsFlorian Pritz1-0/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-06-22mfile: extension -> lexer mapping; mark some functions publicFlorian Pritz1-4/+20
Also assure that autodetect_lexer always returns false if the file can't be highlit. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-06-08mfile/new_id(): rewrite as loop and make min/max parametersFlorian Pritz1-6/+12
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-05-09Change description for "text" in lexer listFlorian Pritz1-0/+1
Pygments calls it "Text only", but users are more likely to search for "plain" than "only" so won't find it in the dropdown. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-04-18new_id(): improve id blacklistFlorian Pritz1-1/+9
We shouldn't use dir or filenames from the top directory as IDs because they won't work if you use mod_rewrite. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-02-23CLI: update_file_metadata: also update mimetypesFlorian Pritz1-2/+9
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-02-14Move cli client login code to muser constructorFlorian Pritz1-0/+21
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-02-13Change license to AGPLFlorian Pritz2-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-02-08Add some mimetypes and sort the listFlorian Pritz1-32/+41
fileinfo uses some different mimetypes than File::MimeInfo. This tries to add most of those that are currently on paste.xinu.at. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-02-04Handle text/x-diff MIME typeFlorian Pritz1-0/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-02-03Use php's fileinfo instead of perl to detect mimetypeFlorian Pritz1-1/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-02-02Add tex highlightingFlorian Pritz1-0/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-01-30Remove userid from session upon logoutFlorian Pritz1-0/+1
No necessary, but better safe than sorry. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-01-30Modularize authentication systemFlorian Pritz1-37/+3
This allows to easily add LDAP and other support. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-01-25Refactor querying action tableFlorian Pritz1-0/+16
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-01-24m/user/username_exists: fix bug on empty/false argumentFlorian Pritz1-0/+4
username_exists(false) returned true because the condition matches any existing user. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-01-09Fix some indentation issuesFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-01-09Fix copyright informationFlorian Pritz2-1/+8
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-10-22switch design to bootstrap; minor fixes along the wayFlorian Pritz1-0/+21
Initial-work-by: Oliver Mader <b52@reaktor42.de> Additional-work-by: Markus Cisler <mrkscslr@gmail.com> Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-10-09Rename $mode to $lexerFlorian Pritz1-16/+16
Pygments calls it that and mode was an undescriptive name anyway. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-09-11file/cron: always remove stale filesFlorian Pritz1-0/+5
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-09-09m/file: add text/x-tcl to autodetectionFlorian Pritz1-0/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-08-28Only create new sessions when the are really neededFlorian Pritz1-3/+38
Most sessions are just people viewing a paste. Those don't need a session until they want to log in so we don't have to pollute the database and waste resources. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-08-16switch to pygmentsFlorian Pritz1-2/+2
- faster than geshi - easier to modify the css because there is only one - geshi upstream seems pretty dead Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-08-09rename file_mod to mfileFlorian Pritz1-1/+1
Muser already uses this scheme as it is easier to type. Signed-off-by: Florian Pritz <bluewind@xinu.at>