diff options
author | Yukai Huang | 2017-01-13 22:53:33 +0800 |
---|---|---|
committer | Yukai Huang | 2017-01-13 22:53:33 +0800 |
commit | 3d6b31921651e71ef68fdc88af4ddef50cc9bcb3 (patch) | |
tree | 8ba3e2a5e57a5d54be071475a96b20f78957eff2 /lib/response.js | |
parent | 3566d71aea5486709f73ba7fac5a421993b41f00 (diff) | |
parent | 3cf40a8dec96af3710a5945dde693fdc949f31af (diff) |
Merge branch 'master' into frontend-next
Diffstat (limited to '')
-rwxr-xr-x | lib/response.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/response.js b/lib/response.js index a0dc8b1f..9014a0a0 100755 --- a/lib/response.js +++ b/lib/response.js @@ -66,7 +66,9 @@ function showIndex(req, res, next) { gitlab: config.gitlab, dropbox: config.dropbox, google: config.google, + ldap: config.ldap, email: config.email, + allowemailregister: config.allowemailregister, signin: req.isAuthenticated(), infoMessage: req.flash('info'), errorMessage: req.flash('error') @@ -94,6 +96,7 @@ function responseHackMD(res, note) { gitlab: config.gitlab, dropbox: config.dropbox, google: config.google, + ldap: config.ldap, email: config.email }); } @@ -122,6 +125,11 @@ function checkViewPermission(req, note) { return false; else return true; + } else if (note.permission == 'limited' || note.permission == 'protected') { + if( !req.isAuthenticated() ) { + return false; + } + return true; } else { return true; } @@ -161,7 +169,7 @@ function showNote(req, res, next) { findNote(req, res, function (note) { // force to use note id var noteId = req.params.noteId; - var id = LZString.compressToBase64(note.id); + var id = LZString.compressToBase64(note.id); if ((note.alias && noteId != note.alias) || (!note.alias && noteId != id)) return res.redirect(config.serverurl + "/" + (note.alias || id)); return responseHackMD(res, note); @@ -413,7 +421,7 @@ function publishSlideActions(req, res, next) { res.redirect(config.serverurl + '/' + (note.alias ? note.alias : LZString.compressToBase64(note.id))); break; default: - res.redirect(config.serverurl + '/p/' + note.shortid); + res.redirect(config.serverurl + '/p/' + note.shortid); break; } }); |