summaryrefslogtreecommitdiffstats
path: root/application/controllers/file.php
AgeCommit message (Collapse)AuthorFilesLines
2012-10-22switch design to bootstrap; minor fixes along the wayFlorian Pritz1-38/+40
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-16Fall back to plain text if lexer is unknown/brokenFlorian Pritz1-13/+46
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-10-10Accept authentication via post parametersFlorian Pritz1-5/+18
Passing the authentication headers is slightly complicated with fastcgi so we support both and let the users choose. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-10-09Rename $mode to $lexerFlorian Pritz1-26/+26
Pygments calls it that and mode was an undescriptive name anyway. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-10-07c/file/download: display an error if highlighting failsFlorian Pritz1-5/+9
Previously we displayed an empty page since stderr usually goes to the error log of the web server. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-10-07c/file/download: remove useless return statementFlorian Pritz1-2/+0
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-10-07c/file/download: stop working around CI's output classFlorian Pritz1-3/+4
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-09-26c/file/_download: urldecode mode to fix lexers with spacesFlorian Pritz1-1/+1
Pygments has lexers with space in the name and those won't work unless we decode them. Example: "Duel View" Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-09-11file/cron: always remove stale filesFlorian Pritz1-0/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-09-10Let pygments guess input encodingFlorian Pritz1-1/+1
Assuming utf8 breaks if the input file is latin1. This automaticaly guesses if it's utf8 or latin1. If this isn't enough, we can switch to chardet, but that adds a new dependency. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-08-31Fix missing require_session callFlorian Pritz1-0/+1
Trigger: echo test | curl -F "file=@-;filename=stdin" <url> Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-08-16Add help message when running file controller via CLIFlorian Pritz1-0/+12
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-08-16remove 'class="no"' from highlit htmlFlorian Pritz1-1/+1
No need to repeat that for every line. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-08-16switch to pygmentsFlorian Pritz1-3/+1
- 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-32/+32
Muser already uses this scheme as it is easier to type. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-07-22display header on client page when using browserFlorian Pritz1-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-07-22fix call to _non_existent() typosFlorian Pritz1-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-07-07Display total size uploaded by user on history pageFlorian Pritz1-0/+11
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-06-12fix missing negation in deleteFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-05-17Move some functions from file_mod to file controllerFlorian Pritz1-5/+181
Models shouldn't really call views Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-05-17improve is_cli_client() and use everywhereFlorian Pritz1-9/+6
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-05-12fix missing object initialization and properly declare class variablesFlorian Pritz1-2/+4
var is deprecated since ages and in strict mode we have to initialize $this->var as a generic object before using it. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-05-10Prevent browsers from deleting filesFlorian Pritz1-0/+5
CLI clients are expected to only request deletion when the users wants it. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-05-05Rework file deletion; allow to delete multiple IDs at onceFlorian Pritz1-19/+46
This removes the old form which was used to delete a single upload and replaces it with checkboxes on the history page. All checked IDs will be removed at once, instead of requiring the user to click through multiple pages. The old file/delete page is kept for compatibility with CLI clients. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-05-03add ID/info to display more information about a fileFlorian Pritz1-10/+3
The table is shared with the old delete_form, but it doesn't display the delete button in info mode. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-21Disable cache for upload_history for now.Florian Pritz1-1/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-15upload_hstory: Initialize $lengths correctlyFlorian Pritz1-5/+16
If you only uploaded short filenames "Filename" could e longer than any filename, resulting in a broken table. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-14claim_id: Fix wrong variable nameFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-14cron: Remove expired, unowned filesFlorian Pritz1-4/+10
Unowned files expire whenever a session expires because the user won't be able to reclaim them anymore. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-14Allow to keep and reclaim uploads without being logged inFlorian Pritz1-5/+21
If a user keeps the browser open until his session expires and then tries to upload something we now add it to the database, add the ID to the new session and when someone logs in with that session the ID is assigned. Until then even if you guess it correctly, you won't be able to download it. If the user still manages to let the 2nd session expire because he can't find his password, the upload will be lost. Shit happens. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-13Hide delete button if user doesn't own the idFlorian Pritz1-0/+2
It won't work anyway. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-13Add nuke_id() commandFlorian Pritz1-0/+26
This can be used to remove an ID and all other IDs referencing the same hash. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-13Add do_paste() and remove ajax from upload_formFlorian Pritz1-5/+39
If the session has timed out, javascript will get the login page and try to redirect to "base_url/$htmlcode" which will obviously fail. Instead of fixing the js code, reintroduce do_paste and use it. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-11Add filesize to history viewFlorian Pritz1-1/+32
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09Move is_cli_client() and random_id() to helperFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09c/file: Style changesFlorian Pritz1-1/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09c/file: remove old commentFlorian Pritz1-2/+0
It doesn't really apply anymore. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09upload_form(): don't require a userFlorian Pritz1-2/+0
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09muser: fix handling of cli clients without accountFlorian Pritz1-9/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09declare used class variablesFlorian Pritz1-0/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09do_upload(): fix errors if no file was uploadedFlorian Pritz1-1/+6
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09Revert "Disable paste box"Florian Pritz1-1/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09improve page titlesFlorian Pritz1-4/+5
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09more user changesFlorian Pritz1-47/+41
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09start working on usersFlorian Pritz1-18/+39
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09Set 404 if a paste doesn't existFlorian Pritz1-0/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-09Disable paste boxFlorian Pritz1-2/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-04-02Fix "Unknown ID" typoFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-02-19move stale file removal to it's own functionFlorian Pritz1-5/+9
This shouldn't be needed and it's also pretty slow. No need to run it with ever cronjob. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2012-02-19file/cron: make accessible via CLI onlyFlorian Pritz1-1/+6
In production environments the cronjob might run quite some time and could be used to overload the server. Signed-off-by: Florian Pritz <bluewind@xinu.at>