From c5d5cb3c864ca381e133a24a2a786604db7880ab Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 15 Jul 2013 13:12:19 +0200 Subject: 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 --- application/controllers/file.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'application/controllers/file.php') 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'); -- cgit v1.2.3-24-g4f1b