dont display email/fullname if they are private

v1.18.x
barisusakli 10 years ago
parent 97633fe01e
commit 719290cd2b

@ -136,11 +136,18 @@ function getUserDataByUserSlug(userslug, callerUID, callback) {
accountsController.getUserByUID = function(req, res, next) {
var uid = req.params.uid ? req.params.uid : 0;
user.getUserData(uid, function(err, userData) {
async.parallel({
settings: async.apply(user.getSettings, uid),
userData: async.apply(user.getUserData, uid)
}, function(err, results) {
if (err) {
return next(err);
}
res.json(userData);
results.userData.email = results.settings.showemail ? results.userData.email : undefined;
results.userData.fullname = results.settings.showfullname ? results.userData.fullname : undefined;
res.json(results.userData);
});
};

@ -104,7 +104,7 @@ var async = require('async'),
}
if (user.password) {
user.password = null;
user.password = undefined;
}
if (!parseInt(user.uid, 10)) {

Loading…
Cancel
Save