Skip to content

Allow only sync users from a group#3203

Open
weilai-irl wants to merge 1 commit into
wip-131037-m500from
wip-127698-m500
Open

Allow only sync users from a group#3203
weilai-irl wants to merge 1 commit into
wip-131037-m500from
wip-127698-m500

Conversation

@weilai-irl

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 27, 2026 16:19
@weilai-irl weilai-irl self-assigned this May 27, 2026
@weilai-irl weilai-irl added this to the 2026-03 milestone May 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an optional "User sync group filter" admin setting that restricts user sync to members (and owners) of a single Microsoft 365 group, and extends photo sync to (a) honor that filter and (b) short-circuit on unchanged photos via a SHA-256 hash stored in local_o365_appassign.photoid.

Changes:

  • New usersyncgroupfilter admin setting (GUID-validated) plus language strings, wired into the user sync settings page.
  • process_users_batched/process_users_delta_batched route through new unified::process_group_members_batched() (members + owners merge) when the filter is set; delta sync silently falls back to unfiltered /users/delta.
  • Photo sync: SHA-256 hash added to get_photos_batch() responses; apply_photo()/apply_photo_public() accept $photohash, refactored to share process_new_photo(), and skip work when the stored hash matches. photoandtimezonesync fetches group UPNs and applies the filter in PHP, with new logging helpers.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
local/o365/settings.php Registers the new usersyncgroupfilter admin setting.
local/o365/lang/en/local_o365.php Adds label, detailed description and validation error strings.
local/o365/classes/adminsetting/usersyncgroupfilter.php New admin_setting_configtext subclass with GUID validation (hardcoded English error).
local/o365/classes/rest/unified.php New group-member listing method (with owner merge), delta fallback stub, and SHA-256 hash on batch photo responses.
local/o365/classes/feature/usersync/main.php Routes user sync through group endpoints when filter set; refactors apply_photo and adds process_new_photo + hash-based skip; exposes get_usersync_group_filter().
local/o365/classes/task/usersync.php Logs group filter, adds group-specific error guidance, expands display-skip list to on-login variants.
local/o365/classes/task/photoandtimezonesync.php Adds sync-options/photo-expiry logging, fetches group UPNs and filters processed users locally, threads photo hash through.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread local/o365/classes/rest/unified.php Outdated
Comment thread local/o365/classes/rest/unified.php Outdated
Comment thread local/o365/classes/adminsetting/usersyncgroupfilter.php Outdated
Comment thread local/o365/classes/feature/usersync/main.php
Comment thread local/o365/classes/task/usersync.php Outdated
Comment thread local/o365/classes/feature/usersync/main.php
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.

[Feature Request] Fetch-level filtering in user sync — avoid downloading entire tenant

2 participants