diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-12-14 06:48:53 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-12-14 06:48:53 +0100 |
| commit | f9a0743696c5e21d81ae0e215e36358788e708df (patch) | |
| tree | 07bc648b9b4f16999caa669ed5faf40f92d0345f /bucky/app/bucky.js | |
| parent | 54b4af27409fba0032faf4c8bed825ce2bc71cce (diff) | |
profile form
Diffstat (limited to 'bucky/app/bucky.js')
| -rw-r--r-- | bucky/app/bucky.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bucky/app/bucky.js b/bucky/app/bucky.js index 2f17ffc..f3ea689 100644 --- a/bucky/app/bucky.js +++ b/bucky/app/bucky.js @@ -375,7 +375,7 @@ var bucky = module.exports = { }) }, - /* PROFILE */ + /* PROFILE / USER */ ensureUser: function (req, res, next){ var username = util.sanitizeName(req.params.username) @@ -396,9 +396,18 @@ var bucky = module.exports = { req.user.set('lastseen', util.now()) req.user.save().then( () => next() ) }, + updateUser: function(req, res, next) { + + }, /* PRIVACY */ - + + checkUserPrivacy: function(req, res, next) { + if (req.user.get('username') !== res.user.get('username')) { + return res.sendStatus(500) + } + next() + }, checkThreadPrivacy: function(req, res, next) { if (req.user.get('ulevel') !== 3 && req.user.get('username') !== res.thread.get('username')) { return res.sendStatus(500) |
