summaryrefslogtreecommitdiffstats
path: root/application/controllers/file.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-07-15 13:12:19 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-07-15 13:12:19 +0200
commitc5d5cb3c864ca381e133a24a2a786604db7880ab (patch)
treedf5ef249ff270dd628316aa7afb44085839169fc /application/controllers/file.php
parent346caed594c7de29017a96b7d76f35be2539f4e3 (diff)
Rework auto login for cli clients
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>
Diffstat (limited to 'application/controllers/file.php')
-rw-r--r--application/controllers/file.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index fcb8717c5..d0884e3f7 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -521,6 +521,11 @@ class File extends CI_Controller {
// Handle pastes
function do_paste()
{
+ // desktop clients get a cookie to claim the ID later
+ if (is_cli_client()) {
+ $this->muser->require_access();
+ }
+
$content = $this->input->post("content");
$filesize = strlen($content);
$filename = "stdin";
@@ -559,6 +564,11 @@ class File extends CI_Controller {
// Handles uploaded files
function do_upload()
{
+ // desktop clients get a cookie to claim the ID later
+ if (is_cli_client()) {
+ $this->muser->require_access();
+ }
+
$ids = array();
$extension = $this->input->post('extension');