change group id to _disabledUsers

This commit is contained in:
Morris Jobke 2016-09-12 16:16:20 +02:00
parent d91b4044fc
commit 7be031ae6d
No known key found for this signature in database
GPG key ID: 9CE5ED29E7FCD38A
5 changed files with 15 additions and 15 deletions

View file

@ -268,15 +268,15 @@ class UsersController extends Controller {
$users = [];
if ($this->isAdmin) {
if($gid !== '' && $gid !== 'disabledUsers') {
if($gid !== '' && $gid !== '_disabledUsers') {
$batch = $this->getUsersForUID($this->groupManager->displayNamesInGroup($gid, $pattern, $limit, $offset));
} else {
$batch = $this->userManager->search($pattern, $limit, $offset);
}
foreach ($batch as $user) {
if( ($gid !== 'disabledUsers' && $user->isEnabled()) ||
($gid === 'disabledUsers' && !$user->isEnabled())
if( ($gid !== '_disabledUsers' && $user->isEnabled()) ||
($gid === '_disabledUsers' && !$user->isEnabled())
) {
$users[] = $this->formatUserForIndex($user);
}
@ -292,7 +292,7 @@ class UsersController extends Controller {
$subAdminOfGroups = $gids;
// Set the $gid parameter to an empty value if the subadmin has no rights to access a specific group
if($gid !== '' && $gid !== 'disabledUsers' && !in_array($gid, $subAdminOfGroups)) {
if($gid !== '' && $gid !== '_disabledUsers' && !in_array($gid, $subAdminOfGroups)) {
$gid = '';
}
@ -317,8 +317,8 @@ class UsersController extends Controller {
$this->groupManager->getUserGroupIds($user),
$subAdminOfGroups
));
if( ($gid !== 'disabledUsers' && $user->isEnabled()) ||
($gid === 'disabledUsers' && !$user->isEnabled())
if( ($gid !== '_disabledUsers' && $user->isEnabled()) ||
($gid === '_disabledUsers' && !$user->isEnabled())
) {
$users[] = $this->formatUserForIndex($user, $userGroups);
}

View file

@ -211,9 +211,9 @@ GroupList = {
showDisabledUsers: function () {
UserList.empty();
UserList.update('disabledUsers');
UserList.update('_disabledUsers');
$userGroupList.find('li').removeClass('active');
GroupList.getGroupLI('disabledUsers').addClass('active');
GroupList.getGroupLI('_disabledUsers').addClass('active');
},
showGroup: function (gid) {

View file

@ -52,7 +52,7 @@ var UserList = {
* }
*/
add: function (user) {
if (this.currentGid && this.currentGid !== '_everyone' && this.currentGid !== 'disabledUsers' && _.indexOf(user.groups, this.currentGid) < 0) {
if (this.currentGid && this.currentGid !== '_everyone' && this.currentGid !== '_disabledUsers' && _.indexOf(user.groups, this.currentGid) < 0) {
return false;
}
@ -936,14 +936,14 @@ $(document).ready(function () {
{username: uid, enabled: setEnabled},
function (result) {
if (result && result.status==='success'){
var count = GroupList.getUserCount(GroupList.getGroupLI('disabledUsers'));
var count = GroupList.getUserCount(GroupList.getGroupLI('_disabledUsers'));
$tr.remove();
if(result.data.enabled == 1) {
$tr.data('userEnabled', true);
GroupList.setUserCount(GroupList.getGroupLI('disabledUsers'), count-1);
GroupList.setUserCount(GroupList.getGroupLI('_disabledUsers'), count-1);
} else {
$tr.data('userEnabled', false);
GroupList.setUserCount(GroupList.getGroupLI('disabledUsers'), count+1);
GroupList.setUserCount(GroupList.getGroupLI('_disabledUsers'), count+1);
}
} else {
OC.dialogs.alert(result.data.message, t('settings', 'Unable to change status of {user}', {user: uid}));

View file

@ -39,7 +39,7 @@
<!-- Disabled Users -->
<?php $disabledUsersGroup = $_["disabledUsersGroup"] ?>
<li data-gid="disabledUsers" data-usercount="<?php if($disabledUsersGroup['usercount'] > 0) { p($disabledUsersGroup['usercount']); } ?>" class="isgroup">
<li data-gid="_disabledUsers" data-usercount="<?php if($disabledUsersGroup['usercount'] > 0) { p($disabledUsersGroup['usercount']); } ?>" class="isgroup">
<a href="#"><span class="groupname"><?php p($l->t('Disabled')); ?></span></a>
<span class="utils">
<span class="usercount"><?php if($disabledUsersGroup['usercount'] > 0) { p($disabledUsersGroup['usercount']); } ?></span>

View file

@ -102,8 +102,8 @@ foreach (OC_User::getUsers() as $uid) {
}
}
$disabledUsersGroup = array(
'id' => 'disabledUsers',
'name' => 'disabledUsers',
'id' => '_disabledUsers',
'name' => '_disabledUsers',
'usercount' => $disabledUsers
);