diff --git a/public/src/admin/manage/users.js b/public/src/admin/manage/users.js index ac40fdbe9a..cc39889807 100644 --- a/public/src/admin/manage/users.js +++ b/public/src/admin/manage/users.js @@ -83,7 +83,7 @@ define('admin/manage/users', ['admin/modules/selectable'], function(selectable) data[cur.name] = cur.value; return data; }, {}); - var until = Date.now() + formData.length * 1000*60*60 * (parseInt(formData.unit, 10) ? 24 : 1); + var until = formData.length ? (Date.now() + formData.length * 1000*60*60 * (parseInt(formData.unit, 10) ? 24 : 1)) : 0; socket.emit('user.banUsers', { uids: uids, until: until }, done('User(s) banned!', '.ban', true)); } } diff --git a/public/src/client/account/header.js b/public/src/client/account/header.js index 0e2477c6d1..616cebbe82 100644 --- a/public/src/client/account/header.js +++ b/public/src/client/account/header.js @@ -121,7 +121,8 @@ define('forum/account/header', [ data[cur.name] = cur.value; return data; }, {}); - var until = Date.now() + formData.length * 1000*60*60 * (parseInt(formData.unit, 10) ? 24 : 1); + var until = formData.length ? (Date.now() + formData.length * 1000*60*60 * (parseInt(formData.unit, 10) ? 24 : 1)) : 0; + socket.emit('user.banUsers', { uids: [ajaxify.data.theirid], until: until }, function(err) { if (err) { return app.alertError(err.message);