Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show users without groups #14614

Closed
wants to merge 11 commits into from
Closed

Conversation

chiefbrain
Copy link

see #14612

Oliver Wittkopf added 3 commits March 10, 2019 18:43
Signed-off-by: Oliver Wittkopf <[email protected]>
Signed-off-by: Oliver Wittkopf <[email protected]>
Signed-off-by: Oliver Wittkopf <[email protected]>
Oliver Wittkopf added 3 commits March 10, 2019 22:22
Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments.

There is a further issue that complicates this scenario: the user backend actually does not have a clue about the memberships, and there might be more than one group backend enabled and users from one backend might belong to groups from a different one. This makes determining all ungrouped users very expensive.

* returns how many enabled users have no groups
*
* @return int
* @since 1?.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

17 (as we're in feature freeze for 16) – but the annotation should go into the Interface \OCP\IUserManager

* @since 1?.0.0
*/
public function countNotGroupedUsers(): int {
$queryBuilder = \OC::$server->getDatabaseConnection()->getQueryBuilder();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the wrong place to gather the information for the database, as the UserManager forwards all requests to the registered Backends. This implementation would go to OC\User\Database. The manager instead would cycle through all registered backends implementing this method (→ needs an Interface, e.g. '\OCP\User\ICountUngroupUsers`), and sum up what each backend returned.

@@ -201,7 +201,18 @@ const actions = {
getUsers(context, { offset, limit, search, group }) {
search = typeof search === 'string' ? search : '';
group = typeof group === 'string' ? group : '';
if (group !== '') {
if (group === 'notGrouped') {
return api.get(OC.linkToOCS(`cloud/users/details?offset=${offset}&limit=${limit}&search=${search}`, 2))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be identical to the following section… why?

@@ -352,7 +354,7 @@ export default {
});

// Every item is added on top of the array, so we're going backward
// Groups, separator, disabled, admin, everyone
// Groups, separator, no groups, separator, admin, disabled, everyone
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the right-most seperator is unnecessary as it is a special group like the others imho

// filter out to re-add later to correct position
groups = groups.filter(group => notGroupedGroup != group);

notGroupedGroup.text = t('settings', 'Users w/o groups'); // rename notGrouped group
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's write out "w/o", for many, especially non-native speaks it might not be clear, and it means different things in different fields (e.g. banking), not making sense, necessarily, but perhaps enough to irritate.

@blizzz
Copy link
Member

blizzz commented Mar 20, 2019

cc @skjnldsv

@blizzz blizzz requested a review from skjnldsv March 20, 2019 12:54
@MorrisJobke MorrisJobke mentioned this pull request Jul 16, 2019
28 tasks
@rullzer rullzer removed this from the Nextcloud 17 milestone Aug 15, 2019
@ChristophWurst
Copy link
Member

Closing as there are many unresolved review comments that never got any attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants