Beliebige Entra-Attribute ins Profil übernehmen; eigene Profilfelder
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m43s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m52s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m49s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m49s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m12s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 1m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 1m59s
CI / Build-Artefakte aktuell (pull_request) Successful in 57s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m43s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m52s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m49s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m49s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m12s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 1m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 1m59s
CI / Build-Artefakte aktuell (pull_request) Successful in 57s
- Profilfelder frei definierbar (Typ, Sichtbarkeit, selbst pflegbar), Werte als JSON am Benutzer - Attribut-Zuordnung je Anbieter statt fester Feldliste: jedes Graph-Attribut inkl. verschachtelter Pfade, onPremisesExtensionAttributes und Verzeichniserweiterungen - Erweiterungsattribute per Knopf aus Entra laden - $select dynamisch aus der Zuordnung; Delta-Abgleich startet bei geänderter Zuordnung neu - Rückfall auf Grundattribute, wenn einzelne Attribute nicht lesbar sind - Ältere Konfiguration (synced_fields) wird weiter gelesen Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
51c94cd0cf
commit
6269d3302c
79 changed files with 1442 additions and 273 deletions
|
|
@ -75,7 +75,14 @@ class EntraDirectorySync
|
|||
|
||||
private function syncUsers(IdentityProvider $provider, EntraClient $client, string $token, float $deadline): void
|
||||
{
|
||||
$url = $this->state($provider, 'next_link') ?: $this->state($provider, 'delta_link') ?: '/users/delta?$select='.EntraProfile::SELECT;
|
||||
$select = EntraAttributes::select($provider);
|
||||
|
||||
// Neue Attribute zugeordnet: Der alte Delta-Link liefert sie nicht – einmal komplett abgleichen.
|
||||
if ($this->state($provider, 'select') !== $select) {
|
||||
$this->saveState($provider, ['delta_link' => null, 'next_link' => null, 'select' => $select]);
|
||||
}
|
||||
|
||||
$url = $this->state($provider, 'next_link') ?: $this->state($provider, 'delta_link') ?: '/users/delta?$select='.$select;
|
||||
|
||||
while ($url && microtime(true) < $deadline) {
|
||||
$response = $client->graph($token)->get($url);
|
||||
|
|
@ -131,7 +138,7 @@ class EntraDirectorySync
|
|||
|
||||
// Ohne Vorab-Anlage: nur bestehende Konten per E-Mail verknüpfen.
|
||||
try {
|
||||
$user = $this->sync->resolveUser($provider, $subject, EntraProfile::fromGraph($graphUser), (bool) $createAllowed);
|
||||
$user = $this->sync->resolveUser($provider, $subject, EntraProfile::fromGraph($provider, $graphUser), (bool) $createAllowed);
|
||||
} catch (IdentityException) {
|
||||
return; // z. B. nicht erlaubte E-Mail-Domain – dieses Konto überspringen
|
||||
}
|
||||
|
|
@ -144,11 +151,7 @@ class EntraDirectorySync
|
|||
}
|
||||
|
||||
// Delta liefert nur geänderte Felder – fehlende Felder nicht leeren.
|
||||
$profile = array_intersect_key(EntraProfile::fromGraph($graphUser), array_flip(array_map(fn ($key) => match ($key) {
|
||||
'givenName' => 'first_name', 'surname' => 'last_name', 'mail' => 'email', 'jobTitle' => 'job_title',
|
||||
'department' => 'department', 'officeLocation' => 'location', 'businessPhones' => 'phone', 'mobilePhone' => 'mobile',
|
||||
'displayName' => 'display_name', default => '-',
|
||||
}, array_keys($graphUser))));
|
||||
$profile = EntraProfile::fromGraph($provider, $graphUser, partial: true);
|
||||
|
||||
$this->sync->syncProfile($provider, $identity->user, $profile);
|
||||
}
|
||||
|
|
@ -156,7 +159,7 @@ class EntraDirectorySync
|
|||
private function syncPhotosAndManagers(IdentityProvider $provider, EntraClient $client, string $token, float $deadline): void
|
||||
{
|
||||
$withPhoto = (bool) $provider->setting('sync_photo', true);
|
||||
$withManager = in_array('manager', $provider->syncedFields(), true);
|
||||
$withManager = $provider->syncsManager();
|
||||
|
||||
if (! $withPhoto && ! $withManager) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue