Commit 3725a161 authored by onny's avatar onny

store files globaly for all users

parent 7f69026d
......@@ -131,7 +131,7 @@ docManager.createDemo = function (padName, padExtension, userid, username) {
};
docManager.saveFileData = function (fileName, userid, username) {
const userAddress = docManager.curUserHostAddress();
const userAddress = "127.0.0.1";
const date_create = fileSystem.statSync(docManager.storagePath(fileName)).mtime;
const minutes = (date_create.getMinutes() < 10 ? '0' : '') + date_create.getMinutes().toString();
const month = (date_create.getMonth() < 10 ? '0' : '') + (parseInt(date_create.getMonth().toString()) + 1);
......@@ -173,7 +173,7 @@ docManager.getServerUrl = function (forDocumentServer) {
docManager.getCallback = function (fileName) {
const server = docManager.getServerUrl(true);
const hostAddress = docManager.curUserHostAddress();
const hostAddress = "127.0.0.1";
const handler = "/track?filename=" + encodeURIComponent(fileName) + "&useraddress=" + encodeURIComponent(hostAddress);
return server + handler;
......@@ -241,6 +241,7 @@ docManager.changesUser = function (fileName, userAddress, version) {
};
docManager.getStoredFiles = function () {
var userAddress = "127.0.0.1";
const directory = path.join(docManager.dir, "public", storageFolder);
this.createDirectory(directory);
const result = [];
......@@ -309,7 +310,7 @@ docManager.getInternalExtension = function (fileType) {
};
docManager.getKey = function (fileName) {
const userAddress = docManager.curUserHostAddress();
const userAddress = "127.0.0.1";
let key = userAddress + docManager.getlocalFileUri(fileName);
let historyPath = docManager.historyPath(fileName, userAddress);
......@@ -356,7 +357,7 @@ docManager.getHistory = function (fileName, content, keyVersion, version) {
}
}
const userAddress = docManager.curUserHostAddress();
const userAddress = "127.0.0.1";
const username = content ? (oldVersion ? contentJson.username : contentJson.user.name) : (docManager.getFileData(fileName, userAddress))[2];
const userid = content ? (oldVersion ? contentJson.userid : contentJson.user.id) : (docManager.getFileData(fileName, userAddress))[1];
const created = content ? (oldVersion ? contentJson.date : contentJson.created) : (docManager.getFileData(fileName, userAddress))[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment