Skip to content

feat: multiple phone number for profile#61125

Open
mykh-hailo wants to merge 1 commit into
nextcloud:masterfrom
mykh-hailo:feat/multiple-phone-number
Open

feat: multiple phone number for profile#61125
mykh-hailo wants to merge 1 commit into
nextcloud:masterfrom
mykh-hailo:feat/multiple-phone-number

Conversation

@mykh-hailo

@mykh-hailo mykh-hailo commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

This change adds support for multiple phone numbers on user accounts, following the same model as additional email addresses.

Previously, personal settings only exposed a single primary phone number via AccountPropertySection. Users can now manage a primary phone number plus additional numbers, including federation scope per entry, from SettingsPersonal info.

Backend

  • Introduce IAccountManager::COLLECTION_PHONE (additional_phone) as a new account property collection (since 33.0.0).
  • Extend the Provisioning API (UsersController) to add, update, remove, and scope additional phone numbers, with the same permission checks used for additional emails.
  • Expose additional_phone and additional_phoneScope in OCS user data responses (AUserDataOCSController).
  • Sanitize additional phone numbers in AccountManager using the existing E.164 validation path.
  • Include additional phone numbers when exporting CardDAV vCards (Converter).
  • Update OpenAPI definitions for the new fields.

Frontend(settings app)

  • Replace the single-field PhoneSection.vue with a dedicated PhoneSection/ component structure:
    • PhoneSection.vue — section layout, validation, and primary/additional phone coordination
    • PhoneSectionEntry.vue — individual phone input with federation controls and actions
    • PhoneService.js — OCS API client for primary and additional phone operations
  • Extend AccountPropertyConstants with PHONE_COLLECTION, readable labels, supported scopes, and DEFAULT_ADDITIONAL_PHONE_SCOPE.
  • Provide phoneMap (primary + additional phones) via initial state in PersonalInfo.php instead of a single phone property.

Behavior

  • Additional phone numbers are validated client-side (libphonenumber-js) and server-side (existing phone sanitization).
  • Duplicate numbers (including matching the primary phone) are rejected by the API.
  • Updating phone numbers clears known-user contact matches, consistent with primary phone changes.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: mykh-hailo <kristianderonta0205@gmail.com>
@mykh-hailo mykh-hailo requested review from CarlSchwan, leftybournes, nfebe, salmart-dev, sorbaugh and susnux and removed request for a team June 9, 2026 20:13
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.

Allow to add multiple phone numbers to the profile

1 participant