|
|
|
@ -46,18 +46,19 @@ module.exports = function (User) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function sendNotificationToAdmins(username, callback) {
|
|
|
|
|
notifications.create({
|
|
|
|
|
bodyShort: '[[notifications:new_register, ' + username + ']]',
|
|
|
|
|
nid: 'new_register:' + username,
|
|
|
|
|
path: '/admin/manage/registration',
|
|
|
|
|
mergeId: 'new_register'
|
|
|
|
|
}, function (err, notification) {
|
|
|
|
|
if (err || !notification) {
|
|
|
|
|
return callback(err);
|
|
|
|
|
async.waterfall([
|
|
|
|
|
function (next) {
|
|
|
|
|
notifications.create({
|
|
|
|
|
bodyShort: '[[notifications:new_register, ' + username + ']]',
|
|
|
|
|
nid: 'new_register:' + username,
|
|
|
|
|
path: '/admin/manage/registration',
|
|
|
|
|
mergeId: 'new_register'
|
|
|
|
|
}, next);
|
|
|
|
|
},
|
|
|
|
|
function (notification, next) {
|
|
|
|
|
notifications.pushGroup(notification, 'administrators', next);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
notifications.pushGroup(notification, 'administrators', callback);
|
|
|
|
|
});
|
|
|
|
|
], callback);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
User.acceptRegistration = function (username, callback) {
|
|
|
|
@ -153,13 +154,11 @@ module.exports = function (User) {
|
|
|
|
|
},
|
|
|
|
|
function (users, next) {
|
|
|
|
|
users = users.map(function (user, index) {
|
|
|
|
|
if (!user) {
|
|
|
|
|
return null;
|
|
|
|
|
if (user) {
|
|
|
|
|
user.timestampISO = utils.toISOString(data[index].score);
|
|
|
|
|
delete user.hashedPassword;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
user.timestampISO = utils.toISOString(data[index].score);
|
|
|
|
|
delete user.hashedPassword;
|
|
|
|
|
|
|
|
|
|
return user;
|
|
|
|
|
}).filter(Boolean);
|
|
|
|
|
|
|
|
|
|