mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
feat: #7527
This commit is contained in:
@@ -30,6 +30,8 @@ events.types = [
|
|||||||
'topic-purge',
|
'topic-purge',
|
||||||
'topic-rename',
|
'topic-rename',
|
||||||
'password-reset',
|
'password-reset',
|
||||||
|
'user-makeAdmin',
|
||||||
|
'user-removeAdmin',
|
||||||
'user-ban',
|
'user-ban',
|
||||||
'user-unban',
|
'user-unban',
|
||||||
'user-delete',
|
'user-delete',
|
||||||
|
|||||||
@@ -28,8 +28,20 @@ User.makeAdmins = function (socket, uids, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async.each(uids, function (uid, next) {
|
async.eachSeries(uids, function (uid, next) {
|
||||||
groups.join('administrators', uid, next);
|
async.waterfall([
|
||||||
|
function (next) {
|
||||||
|
groups.join('administrators', uid, next);
|
||||||
|
},
|
||||||
|
function (next) {
|
||||||
|
events.log({
|
||||||
|
type: 'user-makeAdmin',
|
||||||
|
uid: socket.uid,
|
||||||
|
targetUid: uid,
|
||||||
|
ip: socket.ip,
|
||||||
|
}, next);
|
||||||
|
},
|
||||||
|
], next);
|
||||||
}, next);
|
}, next);
|
||||||
},
|
},
|
||||||
], callback);
|
], callback);
|
||||||
@@ -52,6 +64,14 @@ User.removeAdmins = function (socket, uids, callback) {
|
|||||||
|
|
||||||
groups.leave('administrators', uid, next);
|
groups.leave('administrators', uid, next);
|
||||||
},
|
},
|
||||||
|
function (next) {
|
||||||
|
events.log({
|
||||||
|
type: 'user-removeAdmin',
|
||||||
|
uid: socket.uid,
|
||||||
|
targetUid: uid,
|
||||||
|
ip: socket.ip,
|
||||||
|
}, next);
|
||||||
|
},
|
||||||
], next);
|
], next);
|
||||||
}, callback);
|
}, callback);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user