diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-08-19 21:07:04 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-08-19 21:07:04 +0200 |
commit | 08161027c47284102c44b36cb3253702df4c29a8 (patch) | |
tree | 803dedc2bc8cf0bfdf88160780c7e0274a44477e | |
parent | b3356b12883b3178a4dce78b258e7ebafd2c7c9a (diff) | |
parent | 3a6d273265e527afcdf715a83f72833fd391556e (diff) | |
download | nextcloud-server-08161027c47284102c44b36cb3253702df4c29a8.tar.gz nextcloud-server-08161027c47284102c44b36cb3253702df4c29a8.zip |
Merge pull request #18403 from owncloud/do-not-delete-group-if-empty
Do not delete group if empty, hide delete icon for group admin
-rw-r--r-- | settings/ajax/togglegroups.php | 3 | ||||
-rw-r--r-- | settings/js/users/users.js | 11 | ||||
-rw-r--r-- | settings/templates/users/part.grouplist.php | 2 |
3 files changed, 2 insertions, 14 deletions
diff --git a/settings/ajax/togglegroups.php b/settings/ajax/togglegroups.php index 87b60e485bf..4d248408db0 100644 --- a/settings/ajax/togglegroups.php +++ b/settings/ajax/togglegroups.php @@ -60,9 +60,6 @@ if( OC_Group::inGroup( $username, $group )) { $error = $l->t("Unable to remove user from group %s", $group); $success = OC_Group::removeFromGroup( $username, $group ); $usersInGroup=OC_Group::usersInGroup($group); - if(count($usersInGroup) === 0) { - OC_Group::deleteGroup($group); - } } else{ $success = OC_Group::addToGroup( $username, $group ); diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 4e686a6db8f..5b12366ad40 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -470,17 +470,6 @@ var UserList = { UserList.availableGroups.push(groupName); } - // in case this was the last user in that group the group has to be removed - var groupElement = GroupList.getGroupLI(groupName); - var userCount = GroupList.getUserCount(groupElement); - if (response.data.action === 'remove' && userCount === 1) { - _.without(UserList.availableGroups, groupName); - GroupList.remove(groupName); - $('.groupsselect option').filterAttr('value', groupName).remove(); - $('.subadminsselect option').filterAttr('value', groupName).remove(); - } - - } if (response.data.message) { OC.Notification.show(response.data.message); diff --git a/settings/templates/users/part.grouplist.php b/settings/templates/users/part.grouplist.php index 51638c7bcce..cd6ac4a1e89 100644 --- a/settings/templates/users/part.grouplist.php +++ b/settings/templates/users/part.grouplist.php @@ -43,9 +43,11 @@ </a> <span class="utils"> <span class="usercount"><?php if($group['usercount'] > 0) { p($group['usercount']); } ?></span> + <?php if($_['isAdmin']): ?> <a href="#" class="action delete" original-title="<?php p($l->t('Delete'))?>"> <img src="<?php print_unescaped(image_path('core', 'actions/delete.svg')) ?>" class="svg" /> </a> + <?php endif; ?> </span> </li> <?php endforeach; ?> |