diff options
author | Sheogorath | 2017-10-25 15:56:17 +0200 |
---|---|---|
committer | GitHub | 2017-10-25 15:56:17 +0200 |
commit | be5de239ea27a81b74cb252a162d909fd870ef21 (patch) | |
tree | 0b808b294a37806e10b1277477cf5cf79afa6b02 /lib/response.js | |
parent | c794412714cdd7b0f6ebfadaf108f72098004d64 (diff) | |
parent | f7d2ef970a4b45dcc9d7bb0a4ff47d5915f4e4bc (diff) |
Merge pull request #589 from geekyd/master
Adds enable/disable PDF export via config
Diffstat (limited to 'lib/response.js')
-rwxr-xr-x | lib/response.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/response.js b/lib/response.js index a22d1e70..9e39ffb5 100755 --- a/lib/response.js +++ b/lib/response.js @@ -69,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') @@ -98,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 }) } @@ -382,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) |