add "Admin Approval for IPs", which works like Normal for new users and Admin Approval for sockpuppet accounts (#4882)

This commit is contained in:
Ben Lubar
2016-07-25 09:56:29 -05:00
committed by Julian Lam
parent 754e20eb5c
commit 40b57d6cbe
4 changed files with 14 additions and 2 deletions

View File

@@ -63,6 +63,16 @@ authenticationController.register = function(req, res, next) {
registerAndLoginUser(req, res, userData, next);
} else if (registrationType === 'admin-approval') {
addToApprovalQueue(req, userData, next);
} else if (registrationType === 'admin-approval-ip') {
db.sortedSetCard('ip:' + req.ip + ':uid', function(err, count) {
if (err) {
next(err);
} else if (count) {
addToApprovalQueue(req, userData, next);
} else {
registerAndLoginUser(req, res, userData, next);
}
});
}
}
], function(err, data) {