From 1ef79d44b4312f76148ec29d3e31b4b4e75f3d35 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 8 Jun 2020 11:47:09 -0400 Subject: [PATCH] display a disabled upload button to logged out users in the filepicker modal --- www/secureiframe/inner.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/www/secureiframe/inner.js b/www/secureiframe/inner.js index a42cd5e7a..1aa94d9cd 100644 --- a/www/secureiframe/inner.js +++ b/www/secureiframe/inner.js @@ -177,7 +177,7 @@ define([ }); // If file, display the upload button - if (types.indexOf('file') !== -1 && common.isLoggedIn()) { + if (types.indexOf('file') !== -1) { var f = (filters && filters.filter) || {}; delete data.accept; if (Array.isArray(f.fileType)) { @@ -188,7 +188,13 @@ define([ return val; }); } - $filter.append(common.createButton('upload', false, data)); + } + + var $uploadButton = common.createButton('upload', false, data); + $filter.append($uploadButton); + if (!common.isLoggedIn()) { + $uploadButton.prop('disabled', true) + .prop('title', Messages.upload_mustLogin); } var $container = $(h('span.cp-filepicker-content', [