allow admins to remove themselves as admin

but only if they are not the last admin left
v1.18.x
psychobunny 10 years ago
parent 98cde1a9d6
commit 3a21329c5e

@ -38,10 +38,6 @@ User.removeAdmins = function(socket, uids, callback) {
return callback(new Error('[[error:invalid-data]]'));
}
if (uids.indexOf(socket.uid.toString()) !== -1) {
return callback(new Error('[[error:cant-remove-self-as-admin]]'));
}
async.eachSeries(uids, function(uid, next) {
groups.getMemberCount('administrators', function(err, count) {
if (err) {

Loading…
Cancel
Save