feat(block-user): show "blocked" status in an alert, log the user out

This commit is contained in:
Tyler Renelle 2014-07-25 12:13:26 -06:00
parent 6e29facb98
commit a4ae9332bb
3 changed files with 4 additions and 14 deletions

View file

@ -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) {

View file

@ -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){

View file

@ -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
|&nbsp;
=env.t('logout')
script(type='text/ng-template', id='modals/restore.html')
.modal-header
h4=env.t('fixValues')