summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-08-18 22:03:46 +0200
committerFlorian Pritz <bluewind@xinu.at>2015-08-18 22:03:46 +0200
commitf88977cfbd4636933c5016c2035b77e5639f6c7e (patch)
treee97a90593f926795d0317a3f9209b9b4c002c14c
parent1c247bc4073451ad156ecedfbd2f7ebe73b56c12 (diff)
claim_id: Support multiple upload batches
If the user has multiple tabs open, but is not logged in this will be called multiple times (unless he logs in after the first upload batch) and earlier uploads would be lost. Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--application/controllers/file.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index 868366af0..a78f89bb0 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -516,11 +516,19 @@ class File extends MY_Controller {
if (!$this->muser->logged_in()) {
$this->muser->require_session();
// keep the upload but require the user to login
- $this->session->set_userdata("last_upload", array(
- "ids" => $ids,
- "lexer" => $lexer
- ));
- $this->session->set_flashdata("uri", "file/claim_id");
+ $last_upload = $this->session->userdata("last_upload");
+ if ($last_upload === false) {
+ $last_upload = array(
+ "ids" => [],
+ "lexer" => "",
+ );
+ }
+ $last_upload = array(
+ "ids" => array_merge($last_upload['ids'], $ids),
+ "lexer" => "",
+ );
+ $this->session->set_userdata("last_upload", $last_upload);
+ $this->data["redirect_uri"] = "file/claim_id";
$this->muser->require_access("basic");
}