use User.isAdmin instead

v1.18.x
Baris Usakli 12 years ago
parent d40a6a5c3f
commit e78369f0fa

@ -317,25 +317,23 @@ var utils = require('./../public/src/utils.js'),
return callback(err, null); return callback(err, null);
} }
Groups.getGidFromName('Administrators', function(err, gid) { function iterator(uid, callback) {
User.getUserData(uid, function(err, userData) {
function iterator(uid, callback) { User.isAdministrator(uid, function(isAdmin) {
User.getUserData(uid, function(err, userData) { if (userData) {
Groups.isMember(uid, gid, function(err, isMember) { userData.administrator = isAdmin?"1":"0";
if (userData) { data.push(userData);
userData.administrator = isMember; }
data.push(userData); callback(null);
}
callback(null);
});
}); });
}
async.eachSeries(uids, iterator, function(err) {
callback(err, data);
}); });
}
async.eachSeries(uids, iterator, function(err) {
callback(err, data);
}); });
}); });
} }
User.createGravatarURLFromEmail = function(email) { User.createGravatarURLFromEmail = function(email) {

Loading…
Cancel
Save