mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-24 14:45:36 +00:00
feat(block-user): show "blocked" status in an alert, log the user out
This commit is contained in:
parent
6e29facb98
commit
a4ae9332bb
3 changed files with 4 additions and 14 deletions
|
|
@ -229,7 +229,9 @@ window.habitrpg = angular.module('habitrpg',
|
|||
$rootScope.$broadcast('responseError', "The site has been updated and the page needs to refresh. The last action has not been recorded, please refresh and try again.");
|
||||
|
||||
} else if (response.data.code && response.data.code === 'ACCOUNT_SUSPENDED') {
|
||||
$rootScope.openModal('suspended',{keyboard: false,backdrop: 'static',size: 'lg',controller:'AuthCtrl'});
|
||||
confirm(response.data.err);
|
||||
localStorage.clear();
|
||||
window.location.href = '/logout';
|
||||
|
||||
// 400 range?
|
||||
} else if (response < 500) {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ api.updateHero = function(req,res,next) {
|
|||
&& User.schema.paths[req.body.itemPath]) {
|
||||
shared.dotSet(member, req.body.itemPath, req.body.itemVal); // Sanitization at 5c30944 (deemed unnecessary)
|
||||
}
|
||||
if (req.body.auth.blocked) member.auth.blocked = req.body.auth.blocked;
|
||||
if (_.isBoolean(req.body.auth.blocked)) member.auth.blocked = req.body.auth.blocked;
|
||||
member.save(cb);
|
||||
}
|
||||
], function(err, saved){
|
||||
|
|
|
|||
|
|
@ -8,18 +8,6 @@ script(type='text/ng-template', id='modals/reset.html')
|
|||
button.btn.btn-default(ng-click='$close();')=env.t('neverMind')
|
||||
button.btn.btn-danger(ng-click='$close(); reset()')=env.t('resetDo')
|
||||
|
||||
script(type='text/ng-template', id='modals/suspended.html')
|
||||
.modal-header
|
||||
h4 Account Suspended
|
||||
.modal-body
|
||||
p This account has been suspended. Please contact <a href='mailto:leslie@habitrpg.com' target='_blank'>leslie@habitrpg.com</a> for further assistance.
|
||||
hr
|
||||
p Account UUID: {{::user._id}}
|
||||
a(ng-click='logout()')
|
||||
span.glyphicon.glyphicon-log-out
|
||||
|
|
||||
=env.t('logout')
|
||||
|
||||
script(type='text/ng-template', id='modals/restore.html')
|
||||
.modal-header
|
||||
h4=env.t('fixValues')
|
||||
|
|
|
|||
Loading…
Reference in a new issue