WIP: Implement crm selections

This commit is contained in:
Björn Fromme
2023-10-11 14:35:40 +02:00
parent 7084e1528e
commit b472dab6c8
6 changed files with 103 additions and 5 deletions
+7 -2
View File
@@ -4,6 +4,8 @@ namespace App\Security;
use App\BusProNet\ApiClient;
use App\BusProNet\ApiClientException;
use App\BusProNet\Model\CrmAttribute;
use App\BusProNet\Model\CrmAttributeGroup;
use App\BusProNet\Model\CrmAttributesResponse;
use App\BusProNet\Model\ProfileResponse;
use App\BusProNet\UserDataHandler;
@@ -117,6 +119,9 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
return null;
}
// Flatten selected CRM attributes
$crmSelections = $crmAttributes->toArray();
// Determine teamer status from CRM attributes
$isTeamer = $crmAttributes->isTeamer();
@@ -130,7 +135,7 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
if (null !== $user) {
$this
->userDataHandler
->updateLocalUser($user, $profileResponse, $roles, $isTeamer)
->updateLocalUser($user, $profileResponse, $roles, $isTeamer, $crmSelections)
;
return $user;
@@ -138,7 +143,7 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
return $this
->userDataHandler
->createLocalUser($profileResponse, $roles, $isTeamer)
->createLocalUser($profileResponse, $roles, $isTeamer, $crmSelections)
;
}
}