Lock the UI for unregistered users

pull/1/head
yflory 7 years ago
parent 303adaea4c
commit 0dfae72f88

@ -319,6 +319,9 @@ define(function () {
// OnlyOffice
out.oo_saveError = "Une erreur s'est produite lors de la sauvegarde de vos modifications. Merci de réessayer dans quelques instants.";
out.oo_newVersion = "Une nouvelle version du document est disponible. Cliquez sur OK pour l'ouvrir.";
out.oo_locked = "Ce document est actuellement verrouillé. ";
out.oo_locked_unregistered = "Seuls les utilisateurs enregistrés peuvent le modifier.";
out.oo_locked_edited = "Un seul utilisateur à la fois peut modifier le document.";
// Profile
out.profileButton = "Profil"; // dropdown menu

@ -307,6 +307,9 @@ define(function () {
// OnlyOffice
out.oo_saveError = "We were unable to save your modifications, please try again in a few moments.";
out.oo_newVersion = "A new version of this document is available, click OK to load it.";
out.oo_locked = "This document is currently locked. ";
out.oo_locked_unregistered = "Only registered users can edit.";
out.oo_locked_edited = "Only one person can edit at a time.";
// Canvas
out.canvas_clear = "Clear";

@ -80,7 +80,8 @@ define([
var startOO = function (blob, file) {
if (APP.ooconfig) { return void console.error('already started'); }
var url = URL.createObjectURL(blob);
var lock = locked !== common.getMetadataMgr().getNetfluxId();
var lock = locked !== common.getMetadataMgr().getNetfluxId() ||
!common.isLoggedIn();
// Config
APP.ooconfig = {
@ -122,12 +123,11 @@ define([
'#fm-btn-save { display: none !important; }' +
'#header { display: none !important; }';
$('<style>').text(css).appendTo($tb);
console.log($('iframe[name="frameEditor"]'));
console.log($tb);
return;
$tb.find('> .toolbar-group:visible').first().hide();
$tb.find('> .separator').first().hide();
console.log($tb.find('> .toolbar-group:visible'));
if (UI.findOKButton().length) {
UI.findOKButton().on('focusout', function () {
window.setTimeout(function () { UI.findOKButton().focus(); });
});
}
},
"onAppReady": function(/*evt*/) { console.log("in onAppReady"); },
"onDownloadAs": function (evt) { console.log("in onDownloadAs", evt); }
@ -362,8 +362,15 @@ define([
locked = me;
APP.onLocal();
}
if (!common.isLoggedIn()) {
UI.alert(Messages.oo_locked + Messages.oo_locked_unregistered);
} else if (locked !== me) {
UI.alert(Messages.oo_locked + Messages.oo_locked_edited);
}
}
loadDocument(newDoc);
initializing = false;

Loading…
Cancel
Save