Ability to disable the drive for anonymous users
This commit is contained in:
parent
db0d2e161c
commit
d59bc4612d
@ -68,5 +68,7 @@ define(function() {
|
|||||||
|
|
||||||
config.displayCreationScreen = false;
|
config.displayCreationScreen = false;
|
||||||
|
|
||||||
|
config.disableAnonymousStore = true;
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -29,6 +29,8 @@ define(function () {
|
|||||||
out.typeError = "Ce pad n'est pas compatible avec l'application sélectionnée";
|
out.typeError = "Ce pad n'est pas compatible avec l'application sélectionnée";
|
||||||
out.onLogout = 'Vous êtes déconnecté de votre compte utilisateur, <a href="/" target="_blank">cliquez ici</a> pour vous authentifier<br>ou appuyez sur <em>Échap</em> pour accéder au pad en mode lecture seule.';
|
out.onLogout = 'Vous êtes déconnecté de votre compte utilisateur, <a href="/" target="_blank">cliquez ici</a> pour vous authentifier<br>ou appuyez sur <em>Échap</em> 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.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.loading = "Chargement...";
|
||||||
out.error = "Erreur";
|
out.error = "Erreur";
|
||||||
|
|||||||
@ -32,6 +32,7 @@ define(function () {
|
|||||||
out.onLogout = 'You are logged out, <a href="/" target="_blank">click here</a> to log in<br>or press <em>Escape</em> to access your pad in read-only mode.';
|
out.onLogout = 'You are logged out, <a href="/" target="_blank">click here</a> to log in<br>or press <em>Escape</em> 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.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.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.loading = "Loading...";
|
||||||
out.error = "Error";
|
out.error = "Error";
|
||||||
|
|||||||
@ -10,12 +10,13 @@ define([
|
|||||||
'/common/common-messenger.js',
|
'/common/common-messenger.js',
|
||||||
'/common/outer/chainpad-netflux-worker.js',
|
'/common/outer/chainpad-netflux-worker.js',
|
||||||
'/common/outer/network-config.js',
|
'/common/outer/network-config.js',
|
||||||
|
'/customize/application_config.js',
|
||||||
|
|
||||||
'/bower_components/chainpad-crypto/crypto.js?v=0.1.5',
|
'/bower_components/chainpad-crypto/crypto.js?v=0.1.5',
|
||||||
'/bower_components/chainpad/chainpad.dist.js',
|
'/bower_components/chainpad/chainpad.dist.js',
|
||||||
'/bower_components/chainpad-listmap/chainpad-listmap.js',
|
'/bower_components/chainpad-listmap/chainpad-listmap.js',
|
||||||
], function (UserObject, Migrate, Hash, Util, Constants, Feedback, Realtime, Messaging, Messenger,
|
], function (UserObject, Migrate, Hash, Util, Constants, Feedback, Realtime, Messaging, Messenger,
|
||||||
CpNfWorker, NetConfig,
|
CpNfWorker, NetConfig, AppConfig,
|
||||||
Crypto, ChainPad, Listmap) {
|
Crypto, ChainPad, Listmap) {
|
||||||
var Store = {};
|
var Store = {};
|
||||||
|
|
||||||
@ -524,6 +525,8 @@ define([
|
|||||||
var p = Hash.parsePadUrl(href);
|
var p = Hash.parsePadUrl(href);
|
||||||
var h = p.hashData;
|
var h = p.hashData;
|
||||||
|
|
||||||
|
if (AppConfig.disableAnonymousStore && !store.loggedIn) { return void cb(); }
|
||||||
|
|
||||||
var owners;
|
var owners;
|
||||||
if (Store.channel && Store.channel.wc && Util.base64ToHex(h.channel) === Store.channel.wc.id) {
|
if (Store.channel && Store.channel.wc && Util.base64ToHex(h.channel) === Store.channel.wc.id) {
|
||||||
owners = Store.channel.data.owners || undefined;
|
owners = Store.channel.data.owners || undefined;
|
||||||
|
|||||||
@ -1922,6 +1922,10 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
var displayAllFiles = function ($container) {
|
var displayAllFiles = function ($container) {
|
||||||
|
if (AppConfig.disableAnonymousStore && !APP.loggedIn) {
|
||||||
|
$container.append(Messages.anonymousStoreDisabled);
|
||||||
|
return;
|
||||||
|
}
|
||||||
var allfiles = files[FILES_DATA];
|
var allfiles = files[FILES_DATA];
|
||||||
if (allfiles.length === 0) { return; }
|
if (allfiles.length === 0) { return; }
|
||||||
var $fileHeader = getFileListHeader(false);
|
var $fileHeader = getFileListHeader(false);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user