v1.18.x
barisusakli 10 years ago
parent d2e69884b5
commit 4364b50ecf

@ -35,6 +35,11 @@ function getUsers(set, req, res, next) {
if (err) {
return next(err);
}
users = users.filter(function(user) {
return user && parseInt(user.uid, 10);
});
res.render('admin/manage/users', {
search_display: 'hidden',
loadmore_display: 'block',

@ -244,7 +244,7 @@ var async = require('async'),
user['email:confirmed'] = parseInt(user['email:confirmed'], 10) === 1;
});
callback(err, results.userData);
callback(null, results.userData);
});
};

@ -11,6 +11,9 @@ var async = require('async'),
module.exports = function(User) {
User.delete = function(uid, callback) {
if (!parseInt(uid, 10)) {
return callback(new Error('[[error:invalid-uid]]'));
}
async.waterfall([
function(next) {
deletePosts(uid, next);
@ -52,7 +55,11 @@ module.exports = function(User) {
db.deleteObjectField('userslug:uid', userData.userslug, next);
},
function(next) {
db.deleteObjectField('email:uid', userData.email.toLowerCase(), next);
if (userData.email) {
db.deleteObjectField('email:uid', userData.email.toLowerCase(), next);
} else {
next();
}
},
function(next) {
db.sortedSetsRemove([

Loading…
Cancel
Save