nextcloud / nextcloud/serverinfo

Please count more different user types

Open
#432 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
130
Forks
64
Avg merge
1d 1h
Merged PRs (30d)
49

Description

IMHO the code for "counting users" needs to be improved, especially when it comes to Nextcloud with a subscription key.

Have a look at the Nextcloud "support" app, lib/Service/SubscriptionService.php: It distinguishes and counts different types of users:

  • active users
  • seen users
  • admin users
  • backend users
  • disabled users
  • user count = all users - disabled users

So as a subscription holder and for resellers these values would be helpful (via API):

  • users_enabled: $this->config->getUsersForUserValue('core', 'enabled', 'true');
  • users_disabled: $this->config->getUsersForUserValue('core', 'enabled', 'false');
  • users_backend: Number of users from backends like LDAP
  • users_total: Total number of users known to Nextcloud, enabled and disabled, including users for each backend. Ideally, users_total is users_enabled + users_disabled (today this is called num_users, but I'm not sure if the number is correct)

And these for usage statistics:

  • users_seen_last5minutes: Currently this is activeUsers.last5minutes.
  • users_seen_last1hour: Currently this is activeUsers.last1hour.
  • users_seen_last24hours: Currently this is activeUsers.last24hours.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Nextcloud's support app at lib/Service/SubscriptionService.php and compare its user categories with the serverinfo API's current user-count fields. Trace where num_users and activeUsers.last5minutes, last1hour, and last24hours are assembled; done means the API exposes the requested enabled, disabled, backend, total, and activity counts.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.