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

View File

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

View File

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

View File

@ -39,7 +39,7 @@
<!-- Disabled Users --> <!-- Disabled Users -->
<?php $disabledUsersGroup = $_["disabledUsersGroup"] ?> <?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> <a href="#"><span class="groupname"><?php p($l->t('Disabled')); ?></span></a>
<span class="utils"> <span class="utils">
<span class="usercount"><?php if($disabledUsersGroup['usercount'] > 0) { p($disabledUsersGroup['usercount']); } ?></span> <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( $disabledUsersGroup = array(
'id' => 'disabledUsers', 'id' => '_disabledUsers',
'name' => 'disabledUsers', 'name' => '_disabledUsers',
'usercount' => $disabledUsers 'usercount' => $disabledUsers
); );