diff --git a/customize.dist/application_config.js b/customize.dist/application_config.js
index 0762b5b36..f7790ad66 100644
--- a/customize.dist/application_config.js
+++ b/customize.dist/application_config.js
@@ -68,5 +68,7 @@ define(function() {
config.displayCreationScreen = false;
+ config.disableAnonymousStore = true;
+
return config;
});
diff --git a/customize.dist/src/less2/include/icons.less b/customize.dist/src/less2/include/icons.less
index 85516371a..a79bc25f5 100644
--- a/customize.dist/src/less2/include/icons.less
+++ b/customize.dist/src/less2/include/icons.less
@@ -27,7 +27,6 @@
}
.fa {
display: block;
- margin: auto;
font-size: 64px;
margin: 18px 0;
text-align: center;
diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js
index 8ff3c8de7..869064a8b 100644
--- a/customize.dist/translations/messages.fr.js
+++ b/customize.dist/translations/messages.fr.js
@@ -29,6 +29,8 @@ define(function () {
out.typeError = "Ce pad n'est pas compatible avec l'application sélectionnée";
out.onLogout = 'Vous êtes déconnecté de votre compte utilisateur, cliquez ici pour vous authentifier
ou appuyez sur Échap pour accéder au pad en mode lecture seule.';
out.wrongApp = "Impossible d'afficher le contenu de ce document temps-réel dans votre navigateur. Vous pouvez essayer de recharger la page.";
+ out.padNotPinned = 'Ce pad va expirer dans 3 mois, {0}connectez-vous{1} ou {2}enregistrez-vous{3} pour le préserver.';
+ out.anonymousStoreDisabled = "L'administrateur de cette instance de CryptPad a désactivé le drive pour les utilisateurs non enregistrés. Vous devez vous connecter pour pouvoir utiliser CryptDrive.";
out.loading = "Chargement...";
out.error = "Erreur";
diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js
index a877275fd..6ac63c4ef 100644
--- a/customize.dist/translations/messages.js
+++ b/customize.dist/translations/messages.js
@@ -32,6 +32,7 @@ define(function () {
out.onLogout = 'You are logged out, click here to log in
or press Escape to access your pad in read-only mode.';
out.wrongApp = "Unable to display the content of that realtime session in your browser. Please try to reload that page.";
out.padNotPinned = 'This pad will expire in 3 months, {0}login{1} or {2}register{3} to preserve it.';
+ out.anonymousStoreDisabled = "The webmaster of this CryptPad instance has disabled the store for anonymous users. You have to log in to be able to use CryptDrive.";
out.loading = "Loading...";
out.error = "Error";
diff --git a/www/common/outer/async-store.js b/www/common/outer/async-store.js
index 7d3d15dfd..82cbee00d 100644
--- a/www/common/outer/async-store.js
+++ b/www/common/outer/async-store.js
@@ -10,12 +10,13 @@ define([
'/common/common-messenger.js',
'/common/outer/chainpad-netflux-worker.js',
'/common/outer/network-config.js',
+ '/customize/application_config.js',
'/bower_components/chainpad-crypto/crypto.js?v=0.1.5',
'/bower_components/chainpad/chainpad.dist.js',
'/bower_components/chainpad-listmap/chainpad-listmap.js',
], function (UserObject, Migrate, Hash, Util, Constants, Feedback, Realtime, Messaging, Messenger,
- CpNfWorker, NetConfig,
+ CpNfWorker, NetConfig, AppConfig,
Crypto, ChainPad, Listmap) {
var Store = {};
@@ -524,6 +525,8 @@ define([
var p = Hash.parsePadUrl(href);
var h = p.hashData;
+ if (AppConfig.disableAnonymousStore && !store.loggedIn) { return void cb(); }
+
var owners;
if (Store.channel && Store.channel.wc && Util.base64ToHex(h.channel) === Store.channel.wc.id) {
owners = Store.channel.data.owners || undefined;
diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js
index 3f9960085..55346db6a 100644
--- a/www/common/sframe-common-outer.js
+++ b/www/common/sframe-common-outer.js
@@ -578,7 +578,7 @@ define([
window.location.hash = hash;
};
- var cfg = {
+ var cpNfCfg = {
sframeChan: sframeChan,
channel: secret.channel,
padRpc: Cryptpad.padRpc,
@@ -599,9 +599,9 @@ define([
}
};
Object.keys(rtConfig).forEach(function (k) {
- cfg[k] = rtConfig[k];
+ cpNfCfg[k] = rtConfig[k];
});
- CpNfOuter.start(cfg);
+ CpNfOuter.start(cpNfCfg);
};
sframeChan.on('Q_CREATE_PAD', function (data, cb) {
diff --git a/www/drive/inner.js b/www/drive/inner.js
index afa12fdec..dfc330420 100644
--- a/www/drive/inner.js
+++ b/www/drive/inner.js
@@ -1922,6 +1922,10 @@ define([
};
var displayAllFiles = function ($container) {
+ if (AppConfig.disableAnonymousStore && !APP.loggedIn) {
+ $container.append(Messages.anonymousStoreDisabled);
+ return;
+ }
var allfiles = files[FILES_DATA];
if (allfiles.length === 0) { return; }
var $fileHeader = getFileListHeader(false);
diff --git a/www/filepicker/main.js b/www/filepicker/main.js
index 8b7ab2b60..596cc0a45 100644
--- a/www/filepicker/main.js
+++ b/www/filepicker/main.js
@@ -74,7 +74,6 @@ define([
config.addCommonRpc(sframeChan);
sframeChan.on('Q_GET_FILES_LIST', function (types, cb) {
- console.error("TODO: make sure Q_GET_FILES_LIST is only available from filepicker");
Cryptpad.getSecureFilesList(types, function (err, data) {
cb({
error: err,
diff --git a/www/poll/inner.js b/www/poll/inner.js
index ccddcef19..dd585ec31 100644
--- a/www/poll/inner.js
+++ b/www/poll/inner.js
@@ -751,7 +751,7 @@ define([
}).appendTo($msg);
// Actions
- if (!c.profile || c.profile === profile) {
+ if (!APP.readOnly && (!c.profile || c.profile === profile)) {
$('