diff --git a/settings/js/users/deleteHandler.js b/settings/js/users/deleteHandler.js index a66e8b07a7..4f8d6eea9a 100644 --- a/settings/js/users/deleteHandler.js +++ b/settings/js/users/deleteHandler.js @@ -17,6 +17,9 @@ * @param {removeCallback} removeCallback the function to be called after * successful delete. */ + +/* globals escapeHTML */ + function DeleteHandler(endpoint, paramID, markCallback, removeCallback) { this.oidToDelete = false; this.canceled = false; diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js index 36ebbd2fa6..e83f00970c 100644 --- a/settings/js/users/groups.js +++ b/settings/js/users/groups.js @@ -5,6 +5,8 @@ * See the COPYING-README file. */ +/* globals escapeHTML, UserList, DeleteHandler */ + var $userGroupList, $sortGroupBy; @@ -269,7 +271,7 @@ GroupList = { }, initDeleteHandling: function () { //set up handler - GroupDeleteHandler = new DeleteHandler('/settings/users/groups', 'groupname', + var GroupDeleteHandler = new DeleteHandler('/settings/users/groups', 'groupname', GroupList.hide, GroupList.remove); //configure undo diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 46c67fb831..6be7b2d952 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -6,6 +6,8 @@ * See the COPYING-README file. */ +/* globals escapeHTML, GroupList, DeleteHandler, UserManagementFilter */ + var $userList; var $userListBody; @@ -457,7 +459,7 @@ var UserList = { if (user === OC.currentUser && group === 'admin') { return false; } - if (!oc_isadmin && checked.length === 1 && checked[0] === group) { + if (!OC.isUserAdmin() && checked.length === 1 && checked[0] === group) { return false; } $.post( @@ -500,7 +502,7 @@ var UserList = { GroupList.addGroup(escapeHTML(group)); }; var label; - if (oc_isadmin) { + if (OC.isUserAdmin()) { label = t('settings', 'Add group'); } else { @@ -839,8 +841,8 @@ $(document).ready(function () { if(UserList.availableGroups.indexOf(gid) === -1) { UserList.availableGroups.push(gid); } - $li = GroupList.getGroupLI(gid); - userCount = GroupList.getUserCount($li); + var $li = GroupList.getGroupLI(gid); + var userCount = GroupList.getUserCount($li); GroupList.setUserCount($li, userCount + 1); } }