Skip to content

Commit

Permalink
add patch
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix committed Dec 10, 2024
1 parent b5815e4 commit baa0b17
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion lib/classes/patch/4111PHRAS4106.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,36 @@ public function apply(base $appbox, Application $app)
$conf = $app['conf'];
foreach ($app['conf']->get(['authentication', 'providers'], []) as $providerId => $data) {
if ($data['type'] === "openid") {
if(!isset($data['options']['usegroups'])) {
if (!isset($data['options']['usegroups'])) {
$data['options']['usegroups'] = false;

$providerConfig[$providerId] = $data;

$conf->merge(['authentication', 'providers'], $providerConfig);
}

if (!isset($data['options']['fieldmap'])) {
$data['options']['fieldmap'] = [
'id' => 'sub',
'login' => 'email',
'firstname' => 'given_name',
'lastname' => 'family_name',
'email' => 'email',
'groups' => 'group',
];

$providerConfig[$providerId] = $data;

$conf->merge(['authentication', 'providers'], $providerConfig);
}

if (!isset($data['options']['groupmask'])) {
$data['options']['groupmask'] = "/phraseanet_([^,]+)/i";

$providerConfig[$providerId] = $data;

$conf->merge(['authentication', 'providers'], $providerConfig);
}
}
}

Expand Down

0 comments on commit baa0b17

Please sign in to comment.