Allow only sync users from a group#3203
Open
weilai-irl wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
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
usersyncgroupfilteradmin setting (GUID-validated) plus language strings, wired into the user sync settings page. process_users_batched/process_users_delta_batchedroute through newunified::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 shareprocess_new_photo(), and skip work when the stored hash matches.photoandtimezonesyncfetches 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.
06428e5 to
d7cbf97
Compare
d7cbf97 to
610df87
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.