summaryrefslogtreecommitdiffstats
path: root/application/helpers
AgeCommit message (Collapse)AuthorFilesLines
2017-09-09Merge tag '3.1.5' into dev-ci3Florian Pritz1-1/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-07-04Create function for ensuring that json keys contain objectsFlorian Pritz1-0/+9
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-02-01return_bytes(): Throw exception on unhandled unit typeFlorian Pritz1-1/+5
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-11-10filebin_helper: Fix tabsReikion1-7/+7
Changes by Florian Pritz: - Split off from "Make sure that return_bytes function returns int value" Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-11-10Make sure that return_bytes function returns int valueReikion1-1/+1
php_admin_value[post_max_size] in PHP fpm pool config set to big integer (i.e. 106954752) causes fb-client to crash if file is bigger than 10485760 bytes with traceback Traceback (most recent call last): [...] File "/usr/bin/fb", line 138, in upload_files if self.serverConfig is not None and (currentChunkSize + filesize > self.serverConfig["request_max_size"] \ TypeError: unorderable types: int() > str() because api/v2.1.0/file/get_config returns "request_max_size" as string Changes by Florian Pritz: - Add test - Add github PR body as commit message - Split off indentation change Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-11-05Rename is_cli_client to is_api_clientFlorian Pritz1-7/+7
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-11-05Drop user agent based cli client detectionFlorian Pritz1-7/+0
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2016-01-24PHP7: Ignore Notice when getting mimetype0.9.10Florian Pritz1-0/+5
Sometimes php7 throws an internal notice in this function which we convert to an exception. Catching the exception will however not set $mimetype so this error needs to be ignored. This should be removed once php has fixed the bug. References: https://bugs.php.net/bug.php?id=71434 Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-09-14API 1.4: Add more values to file/get_configFlorian Pritz1-0/+12
These are necessary for clients that want to send lots of fields e.g. in a delete request or upload multiple files in one upload request. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-05-28JS: Use newest file time for cache buster0.9.2Florian Pritz1-2/+20
Really no need to reload the files with each page load. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-05-21Support multiple files with the same hashFlorian Pritz1-0/+27
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-05-05Set cache buster for js with urlArgs settingJoakim Reinert1-4/+3
No more need for timestamp in filename of minified main js
2015-05-05Add support for minified main.jsJoakim Reinert1-0/+7
2015-05-05Use require.js for javascript loadingJoakim Reinert1-24/+0
2015-04-08Cache filedataFlorian Pritz1-1/+18
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-02helper: Add cache_function_fullFlorian Pritz1-1/+18
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-03-02Add imagemagick supportFlorian Pritz1-0/+8
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-15add <!DOCTYPE html>Tjoosten1-1/+2
2015-01-16improve api errorsFlorian Pritz1-2/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2015-01-16first go at reworking; needs to be redesignedFlorian Pritz1-0/+16
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-11-09implement cache_function to easily cache return values of functionsFlorian Pritz1-0/+18
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-23Implement rangeDownload() as driver and provide sendfile implementations for ↵Pierre Schmitz1-99/+0
Nginx and Lighttpd * The rangeDownload() function has been moved to libraries/Ddownload/drivers/Ddownload_php.php * The nginx and lighttpd drivers can be set via $config['download_driver'] Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2013-09-22Move user_logged_in check to controller constructorFlorian Pritz1-7/+0
TL;DR: Allows us to show a proper error page if encryption_key is missing from the config. muser->logged_in() can load the session class which will die if encryption_key is not set in the config causing an error to be displayed. Because the header is also loaded when we display an error loading the class will be tried again. CI maintains an array with information which classes have been tried to be loaded and will simply return true without loading again. muser->logged_in() will then try to access $this->session which doesn't exist. Since all of this happens when we are already in the header the error message appears in the navigation being hard to read. 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-04Fix off-by-one error in random_alphanum()Florian Pritz1-1/+1
This could result in too short strings Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-04Only store session information for stateful clientsFlorian Pritz1-0/+15
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-04Generalize request_type() to static_storage()Florian Pritz1-5/+9
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-02Provide json output for api functionsFlorian Pritz1-2/+17
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-09-02user_logged_in(): always load muserFlorian Pritz1-0/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-08-11Remove api keys dependency on usernameFlorian Pritz1-0/+6
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-07-18Add json support to upload_historyFlorian Pritz1-0/+7
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-05-23Rework javascript inclusionFlorian Pritz1-0/+24
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-05-10Hide function not supported by auth driverFlorian Pritz1-0/+15
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2013-01-17Support multiple uploads in the same requestFlorian Pritz1-0/+28
This change *should* be backwards compatible. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-07-02Only send a Content-Range header when we output a rangeFlorian Pritz1-2/+2
Sending it without being asked for a range breaks tnftp. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-06-22format_bytes(): fix bug if size=0Florian Pritz1-5/+18
If $size is 0 log() will return -INF leading to an "undefined offset" error when trying to get the suffix. We fix this by copying the code from fb-client which handles this issue correctly and will also work for sizes above the biggest suffix (won't happen here, but who cares). Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-06-09detect new curl user agentFlorian Pritz1-1/+1
curl 7.26.0 changed the user agent format to "curl/$version" and no longer sends the library version. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-05-17Move some functions from file_mod to file controllerFlorian Pritz1-0/+22
Models shouldn't really call views Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-05-17improve is_cli_client() and use everywhereFlorian Pritz1-7/+16
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-05-01use function to generate links to css filesFlorian Pritz1-0/+11
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09random_id() -> random_alphanum(); allow single argumentFlorian Pritz1-3/+7
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09Move is_cli_client() and random_id() to helperFlorian Pritz1-0/+27
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2011-09-11add upload_history pageFlorian Pritz1-0/+64
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2011-06-11support simple request ranges for direct downloadsFlorian Pritz1-0/+99
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2011-05-28use correct suffixes for sizesFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
2011-04-10update to CI 2.0.2Florian Pritz1-0/+0
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
2011-01-28update to CI 2.0Florian Pritz2-0/+20
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
2010-03-25moved application folder outside of the system folderDerek Jones1-0/+10