From b30c8e126d9629d9ce2debfcd18cab59ac15efc8 Mon Sep 17 00:00:00 2001 From: Aysam Guerler Date: Mon, 14 Oct 2013 15:11:49 -0400 Subject: [PATCH] Upload box add user validation --- static/scripts/galaxy.upload.js | 4 ++++ static/scripts/utils/galaxy.uploadbox.js | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/static/scripts/galaxy.upload.js b/static/scripts/galaxy.upload.js index d0e13e7d059..340dac9dffe 100644 --- a/static/scripts/galaxy.upload.js +++ b/static/scripts/galaxy.upload.js @@ -57,6 +57,10 @@ var GalaxyUpload = Backbone.View.extend( return; } + // check if logged in + if (!Galaxy.currUser.get('id')) + return; + // add activate icon var self = this; this.button_show = new mod_master.GalaxyMasterIcon ( diff --git a/static/scripts/utils/galaxy.uploadbox.js b/static/scripts/utils/galaxy.uploadbox.js index 392a696e02c..e9d48c0fbb3 100755 --- a/static/scripts/utils/galaxy.uploadbox.js +++ b/static/scripts/utils/galaxy.uploadbox.js @@ -24,7 +24,8 @@ error_filesize : "File exceeds 2GB. Please use an FTP client.", error_default : "Please make sure the file is available.", error_server : "The server is unavailable.", - error_toomany : "You can only queue <20 files per upload session." + error_toomany : "You can only queue <20 files per upload session.", + error_login : "Uploads require you to log in." } // options @@ -292,7 +293,13 @@ { // format error var text = xhr.statusText; - if (!xhr.statusText) { + + // format status + if (xhr.status == 403) + text = opts.error_login; + + // text + if (!text) { if (xhr.status == 0) text = opts.error_server; else