mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-04 15:58:17 +02:00
add "Admin Approval for IPs", which works like Normal for new users and Admin Approval for sockpuppet accounts (#4882)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -113,7 +113,7 @@ Controllers.login = function(req, res, next) {
|
||||
data.alternate_logins = loginStrategies.length > 0;
|
||||
data.authentication = loginStrategies;
|
||||
data.allowLocalLogin = parseInt(meta.config.allowLocalLogin, 10) === 1 || parseInt(req.query.local, 10) === 1;
|
||||
data.allowRegistration = registrationType === 'normal' || registrationType === 'admin-approval';
|
||||
data.allowRegistration = registrationType === 'normal' || registrationType === 'admin-approval' || registrationType === 'admin-approval-ip';
|
||||
data.allowLoginWith = '[[login:' + allowLoginWith + ']]';
|
||||
data.breadcrumbs = helpers.buildBreadcrumbs([{text: '[[global:login]]'}]);
|
||||
data.error = req.flash('error')[0] || errorText;
|
||||
|
||||
Reference in New Issue
Block a user