showing temporary ban indicator in Users ACP, #4807

v1.18.x
Julian Lam 9 years ago
parent ad9229fec2
commit a2b0576b79

@ -55,6 +55,16 @@ module.exports = function(User) {
return callback(err);
}
if (fields.indexOf('banned') !== -1) {
// Also retrieve ban expiry for these users
db.sortedSetScores('users:banned:expire', uids, function(err, scores) {
users = users.map(function(userObj, idx) {
userObj.banned_until = scores[idx] || 0;
userObj.banned_until_readable = scores[idx] ? new Date(scores[idx]).toISOString() : 'Not Banned';
});
});
}
modifyUserData(users, fieldsToRemove, callback);
});
};

@ -72,7 +72,7 @@
<!-- ENDIF !users.email:confirmed -->
<!-- ENDIF config.requireEmailConfirmation -->
<span class="administrator label label-primary <!-- IF !users.administrator -->hide<!-- ENDIF !users.administrator -->">Admin</span>
<span class="ban label label-danger <!-- IF !users.banned -->hide<!-- ENDIF !users.banned -->">Banned</span>
<span class="ban label label-danger <!-- IF !users.banned -->hide<!-- ENDIF !users.banned -->">Banned<!-- IF users.banned_until --> <i class="fa fa-clock-o" title="Banned until {../banned_until_readable}"></i><!-- ENDIF users.banned_until --></span>
</div>
</div>

Loading…
Cancel
Save