chg: [users view] added KC checks for the profile link

pull/101/head
iglocska 2022-05-17 10:47:25 +02:00
parent be064bb0c9
commit c6572885a9
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 60 additions and 49 deletions

View File

@ -1,9 +1,6 @@
<?php
echo $this->element(
'/genericElements/SingleViews/single_view',
[
'data' => $entity,
'fields' => [
$kcurl = $keycloakConfig['provider']['baseUrl'] . '/realms/' . $keycloakConfig['provider']['realm'] . '/account/#/security/signingin';
$fields = [
[
'key' => __('ID'),
'path' => 'id'
@ -51,7 +48,21 @@ echo $this->element(
'path' => 'individual',
'scope' => 'individuals'
]
],
];
if ($keycloakConfig['enabled'] && $loggedUser['id'] == $entity['id']) {
$fields[] = [
'type' => 'generic',
'key' => __('Modify keycloak profile'),
'path' => 'username',
'url' => $kcurl,
'requirements' => false
];
}
echo $this->element(
'/genericElements/SingleViews/single_view',
[
'data' => $entity,
'fields' => $fields,
'children' => [
[
'url' => '/AuthKeys/index?Users.id={{0}}',