From 9e1f49c1779d1e66b3a9c09a6e54fd0acd42a827 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 15 Jan 2020 15:33:52 +0100 Subject: [PATCH] Enable spreadsheets for anonymous users --- www/common/application_config_internal.js | 2 +- www/common/onlyoffice/inner.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/www/common/application_config_internal.js b/www/common/application_config_internal.js index d4c1954e4..900a9ec28 100644 --- a/www/common/application_config_internal.js +++ b/www/common/application_config_internal.js @@ -20,7 +20,7 @@ define(function() { * users and these users will be redirected to the login page if they still try to access * the app */ - config.registeredOnlyTypes = ['file', 'contacts', 'oodoc', 'ooslide', 'sheet', 'notifications']; + config.registeredOnlyTypes = ['file', 'contacts', 'oodoc', 'ooslide', 'notifications']; /* CryptPad is available is multiple languages, but only English and French are maintained * by the developers. The other languages may be outdated, and any missing string for a langauge diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index a40ccccae..c22ca019c 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -584,7 +584,9 @@ define([ ooChannel.cpIndex++; ooChannel.lastHash = hash; // Check if a checkpoint is needed - if (ooChannel.cpIndex % CHECKPOINT_INTERVAL === 0) { + var lastCp = getLastCp(); + if (common.isLoggedIn() && (ooChannel.cpIndex % CHECKPOINT_INTERVAL === 0 || + (ooChannel.cpIndex - lastCp.index) > CHECKPOINT_INTERVAL)) { makeCheckpoint(); } // Remove my lock @@ -662,7 +664,7 @@ define([ var startOO = function (blob, file) { if (APP.ooconfig) { return void console.error('already started'); } var url = URL.createObjectURL(blob); - var lock = readOnly || !common.isLoggedIn(); + var lock = readOnly;// || !common.isLoggedIn(); // Config APP.ooconfig = {