Compare commits

..

7 Commits

2 changed files with 9 additions and 7 deletions

View File

@ -17,7 +17,7 @@
*/
// connect the necessary packages and modules
const crypto = require("crypto");
const crypto = require('crypto');
const express = require('express');
const path = require('path');
const favicon = require('serve-favicon');
@ -35,9 +35,9 @@ const documentService = require('./helpers/documentService');
const fileUtility = require('./helpers/fileUtility');
const wopiApp = require('./helpers/wopi/wopiRouting');
const users = require('./helpers/users');
const dataAutofill = require('./config/data.json');
const configServer = config.get('server');
const data = require('./config/data.json');
const siteUrl = configServer.get('siteUrl');
const enableForgotten = configServer.get('enableForgotten');
const fileChoiceUrl = configServer.has('fileChoiceUrl') ? configServer.get('fileChoiceUrl') : '';
@ -231,8 +231,8 @@ app.get('/data', (req, res) => { // define a handler for getting sample ai form
}
res.send({
data: data,
code: crypto.randomBytes(16).toString("hex"),
data: dataAutofill,
code: crypto.randomBytes(16).toString('hex'),
});
});
@ -1219,7 +1219,9 @@ app.get('/editor', (req, res) => { // define a handler for editing document
}
let pluginsConfig;
if (fileType === fileUtility.fileType.pdf && userid !== 'uid-0') {
if (fileType === fileUtility.fileType.pdf // pdf form only
&& userid !== 'uid-0' // users only
&& mode !== 'comment') { // form field must be editable
const baseUrl = configServer.has('exampleUrl') && configServer.get('exampleUrl')
? configServer.get('exampleUrl')
: req.DocManager.getServerUrl();
@ -1229,7 +1231,7 @@ app.get('/editor', (req, res) => { // define a handler for editing document
pluginsConfig = {
autostart: [...new Set([
pluginGuid,
(mode === 'fillForms' ? pluginGuid : []),
...(plugins.autostart || []),
])],
options: {