mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Added user banning
This commit is contained in:
@ -17,6 +17,7 @@ App.Auth = function(_, jQuery, util, api, appState, promise) {
|
||||
changeAllPasswords: 'changeAllPasswords',
|
||||
deleteOwnAccount: 'deleteOwnAccount',
|
||||
deleteAllAccounts: 'deleteAllAccounts',
|
||||
ban: 'ban',
|
||||
|
||||
listSafePosts: 'listSafePosts',
|
||||
listSketchyPosts: 'listSketchyPosts',
|
||||
|
@ -22,6 +22,8 @@ App.Presenters.UserAccountSettingsPresenter = function(
|
||||
target = args.target;
|
||||
|
||||
privileges = {
|
||||
canBan:
|
||||
auth.hasPrivilege(auth.privileges.ban),
|
||||
canChangeAccessRank:
|
||||
auth.hasPrivilege(auth.privileges.changeAccessRank),
|
||||
canChangeAvatarStyle:
|
||||
@ -105,6 +107,9 @@ App.Presenters.UserAccountSettingsPresenter = function(
|
||||
if (privileges.canChangeAccessRank) {
|
||||
formData.accessRank = $el.find('[name=access-rank]:checked').val();
|
||||
}
|
||||
if (privileges.canBan) {
|
||||
formData.banned = $el.find('[name=ban]').is(':checked') ? 1 : 0;
|
||||
}
|
||||
|
||||
if (!validateAccountSettingsFormData(formData)) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user