From 9770983fdb12c0a00961bfc89caba231e884a845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 29 Nov 2015 16:49:07 -0500 Subject: [PATCH] closes #3913 --- public/src/admin/manage/users.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/public/src/admin/manage/users.js b/public/src/admin/manage/users.js index ece62335cc..b59543d035 100644 --- a/public/src/admin/manage/users.js +++ b/public/src/admin/manage/users.js @@ -1,11 +1,9 @@ "use strict"; -/* global config, socket, define, templates, bootbox, app, ajaxify, */ +/* global config, socket, define, templates, bootbox, app, ajaxify */ define('admin/manage/users', ['admin/modules/selectable'], function(selectable) { var Users = {}; Users.init = function() { - var yourid = ajaxify.data.yourid; - selectable.enable('#users-container', '.user-selectable'); function getSelectedUids() { @@ -94,7 +92,7 @@ define('admin/manage/users', ['admin/modules/selectable'], function(selectable) return; } - if (uids.indexOf(yourid) !== -1) { + if (uids.indexOf(app.user.uid.toString()) !== -1) { app.alertError('You can\'t remove yourself as Administrator!'); } else { socket.emit('admin.user.makeAdmins', uids, done('User(s) are now administrators.', '.administrator', true)); @@ -108,7 +106,7 @@ define('admin/manage/users', ['admin/modules/selectable'], function(selectable) return; } - if (uids.indexOf(yourid.toString()) !== -1) { + if (uids.indexOf(app.user.uid.toString()) !== -1) { app.alertError('You can\'t remove yourself as Administrator!'); } else { bootbox.confirm('Do you really want to remove admins?', function(confirm) {