diff options
Diffstat (limited to 'lib/response.js')
-rwxr-xr-x | lib/response.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/response.js b/lib/response.js index a9abd1d4..9e39ffb5 100755 --- a/lib/response.js +++ b/lib/response.js @@ -13,6 +13,7 @@ var moment = require('moment') var config = require('./config') var logger = require('./logger') var models = require('./models') +var utils = require('./utils') // public var response = { @@ -68,6 +69,7 @@ function showIndex (req, res, next) { ldap: config.isLDAPEnable, email: config.isEmailEnable, allowemailregister: config.allowemailregister, + allowpdfexport: config.allowpdfexport, signin: req.isAuthenticated(), infoMessage: req.flash('info'), errorMessage: req.flash('error') @@ -97,7 +99,8 @@ function responseHackMD (res, note) { google: config.isGoogleEnable, ldap: config.isLDAPEnable, email: config.isEmailEnable, - allowemailregister: config.allowemailregister + allowemailregister: config.allowemailregister, + allowpdfexport: config.allowpdfexport }) } @@ -381,7 +384,12 @@ function noteActions (req, res, next) { actionInfo(req, res, note) break case 'pdf': - actionPDF(req, res, note) + if (config.allowpdfexport) { + actionPDF(req, res, note) + } else { + logger.error('PDF export failed: Disabled by config. Set "allowpdfexport: true" to enable. Check the documentation for details') + response.errorForbidden(res) + } break case 'gist': actionGist(req, res, note) @@ -574,6 +582,7 @@ function showPublishSlide (req, res, next) { updatetime: updatetime, url: origin, body: markdown, + theme: meta.slideOptions && utils.isRevealTheme(meta.slideOptions.theme), meta: JSON.stringify(extracted.meta), useCDN: config.usecdn, owner: note.owner ? note.owner.id : null, |