diff --git a/CHANGELOG.md b/CHANGELOG.md index 86ef8fc..aeeba3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Version 1.4.1 - Added Email Notification to all Members when Review is started (and not pending anymore) + - Added Password Generation on Cover Sheet - bugfixes & style improvements # Version 1.4.0 diff --git a/controllers/documents/generate_files.js b/controllers/documents/generate_files.js index d548d47..bda9560 100644 --- a/controllers/documents/generate_files.js +++ b/controllers/documents/generate_files.js @@ -9,6 +9,7 @@ var moment = require('moment'); var pool = require('../../server.js').pool; var pdf = require('html-pdf'); var uuid = require("uuid"); +var crypto = require('crypto'); var fs = require("fs"); var dir_1 = "/../../templates/pdfs/"; @@ -163,11 +164,23 @@ exports.request = function(req, res) { // Create files async.parallel([ function(callback) { // Generate Cover Sheet + + // create distinguishable password + var psw = crypto.randomBytes(32) + .toString('base64') + .replace("1","R") + .replace("I","A") + .replace("0","M") + .replace("O","P") + .replace("U","F") + .replace("V","Z") + .replace("Q","X"); // Render HTML-content var html = mustache.render(template_cover_sheet, { document: document, description: description, revision: revision, + veracryptpassword: psw, year: moment().format("YYYY") }); diff --git a/templates/pdfs/cover_sheet.html b/templates/pdfs/cover_sheet.html index 510becf..e7656fa 100644 --- a/templates/pdfs/cover_sheet.html +++ b/templates/pdfs/cover_sheet.html @@ -25,36 +25,43 @@

Cover sheet for research study

Document ID:

-

+

{{document.document_id}}


- Revision: + Name of the Researcher:

-

- {{revision.version}} +

+ {{description.en_researcher}}


- Date of last Revision: + Title of study:

-

- {{revision.updated}} +

+ {{document.document_title}}


- Name of the Researcher: + Revision Number:

-

- {{description.en_researcher}} +

+ {{revision.version}}


- Title of study: + Date of last Revision:

-

- {{document.document_title}} +

+ {{revision.updated}} +

+
+

+ Veracrypt Password: +

+

+ {{veracryptpassword}}

\ No newline at end of file