Skip to content

fix: refuse accounts named after a WordPress login unless an admin creates them - #31

Merged
vitormattos merged 1 commit into
fix/require-wordpress-linkfrom
fix/refuse-wordpress-logins-to-subadmins
Nov 14, 2026
Merged

vitormattos merged 1 commit into
fix/require-wordpress-linkfrom
fix/refuse-wordpress-logins-to-subadmins

Conversation

@YvesCesar

Copy link
Copy Markdown
Member

What was wrong

Nextcloud lets a sub-admin create accounts with any free uid in their groups. Nothing stopped a sub-admin from creating an account whose uid is the login of an existing WordPress user that is not yet in Nextcloud, taking that name before the real customer is provisioned.

What changed

  • New BeforeUserCreatedListener: when there is a logged in user who is neither an administrator nor a delegated administrator, it refuses to create an account whose uid is exactly a WordPress user_login.
  • Creation without a session (occ, background jobs) and by administrators, which is how Admin Group Manager provisions customers, is not affected.
  • README mentions the restriction.

How it was verified

  • New unit tests: a sub-admin cannot create a uid that is a WordPress login; it can create a uid that is not; administrators, delegated administrators and creation without a session are allowed.
  • composer run lint and composer run test:unit pass locally.
  • On a local Nextcloud, with a test sub-admin in session, creating an account named after a WordPress login was refused and creating another name succeeded.

Based on #30.

…eates them

Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
@vitormattos
vitormattos merged commit f9c138b into fix/require-wordpress-link Nov 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants