From 20e9b2ca878c40a09c4e597ca9830387c3a55d4a Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 26 Aug 2021 11:25:51 +0200 Subject: [PATCH] Make the form readonly when unregistered users can't send responses --- www/form/inner.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/www/form/inner.js b/www/form/inner.js index f440dd49a..11d4b665f 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -2949,6 +2949,13 @@ define([ if (infoTxt) { $container.prepend(h('div.alert.alert-info', infoTxt)); } + + if (!loggedIn && !content.answers.anonymous) { + APP.formBlocks.forEach(function (b) { + if (!b.setEditable) { return; } + b.setEditable(false); + }); + } } // Embed mode is enforced so we add the title at the top and a CryptPad logo