2020-06-19 00:42:10 +02:00
|
|
|
<?php
|
2022-11-14 11:07:52 +01:00
|
|
|
if (!empty($keycloakConfig['enabled'])) {
|
|
|
|
$kcurl = $keycloakConfig['provider']['baseUrl'] . '/realms/' . $keycloakConfig['provider']['realm'] . '/account/#/security/signingin';
|
|
|
|
}
|
2022-05-17 10:47:25 +02:00
|
|
|
$fields = [
|
|
|
|
[
|
|
|
|
'key' => __('ID'),
|
|
|
|
'path' => 'id'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'key' => __('UUID'),
|
|
|
|
'path' => 'uuid'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'key' => __('Username'),
|
|
|
|
'path' => 'username'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'generic',
|
|
|
|
'key' => __('Email'),
|
|
|
|
'path' => 'individual.email',
|
|
|
|
'url' => '/individuals/view/{{0}}',
|
|
|
|
'url_vars' => 'individual_id'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'generic',
|
|
|
|
'key' => __('Organisation'),
|
|
|
|
'path' => 'organisation.name',
|
|
|
|
'url' => '/organisations/view/{{0}}',
|
|
|
|
'url_vars' => 'organisation.id'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'type' => 'generic',
|
|
|
|
'key' => __('Role'),
|
|
|
|
'path' => 'role.name',
|
|
|
|
'url' => '/roles/view/{{0}}',
|
|
|
|
'url_vars' => 'role.id'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'key' => __('First name'),
|
|
|
|
'path' => 'individual.first_name'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'key' => __('Last name'),
|
|
|
|
'path' => 'individual.last_name'
|
|
|
|
],
|
2023-05-25 16:22:49 +02:00
|
|
|
[
|
|
|
|
'key' => __('Country'),
|
|
|
|
'path' => 'organisation.nationality'
|
|
|
|
],
|
2022-05-17 10:47:25 +02:00
|
|
|
[
|
|
|
|
'key' => __('Alignments'),
|
|
|
|
'type' => 'alignment',
|
|
|
|
'path' => 'individual',
|
|
|
|
'scope' => 'individuals'
|
|
|
|
]
|
|
|
|
];
|
2022-12-09 11:53:20 +01:00
|
|
|
if ($keycloakConfig['enabled']) {
|
2022-05-17 10:47:25 +02:00
|
|
|
$fields[] = [
|
2022-12-09 11:53:20 +01:00
|
|
|
'key' => __('Keycloak status'),
|
|
|
|
'type' => 'keycloakStatus',
|
|
|
|
'path' => 'keycloak_status',
|
|
|
|
'requirements' => !empty($keycloakConfig['enabled']),
|
2022-05-17 10:47:25 +02:00
|
|
|
];
|
2022-12-09 11:53:20 +01:00
|
|
|
if ($loggedUser['id'] == $entity['id']) {
|
|
|
|
$fields[] = [
|
|
|
|
'type' => 'generic',
|
|
|
|
'key' => __('Modify keycloak profile'),
|
|
|
|
'path' => 'username',
|
|
|
|
'url' => $kcurl,
|
|
|
|
'requirements' => false
|
|
|
|
];
|
|
|
|
}
|
2022-05-17 10:47:25 +02:00
|
|
|
}
|
2020-06-19 00:42:10 +02:00
|
|
|
echo $this->element(
|
|
|
|
'/genericElements/SingleViews/single_view',
|
|
|
|
[
|
|
|
|
'data' => $entity,
|
2022-05-17 10:47:25 +02:00
|
|
|
'fields' => $fields,
|
2020-06-21 21:34:15 +02:00
|
|
|
'children' => [
|
|
|
|
[
|
2021-06-28 23:43:42 +02:00
|
|
|
'url' => '/AuthKeys/index?Users.id={{0}}',
|
2020-06-21 21:34:15 +02:00
|
|
|
'url_params' => ['id'],
|
|
|
|
'title' => __('Authentication keys')
|
|
|
|
],
|
|
|
|
[
|
2022-01-18 16:56:38 +01:00
|
|
|
'url' => '/EncryptionKeys/index?owner_id={{0}}',
|
|
|
|
'url_params' => ['individual_id'],
|
2020-06-21 21:34:15 +02:00
|
|
|
'title' => __('Encryption keys')
|
2021-10-08 10:27:40 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'url' => '/UserSettings/index?Users.id={{0}}',
|
|
|
|
'url_params' => ['id'],
|
|
|
|
'title' => __('User settings')
|
2020-06-21 21:34:15 +02:00
|
|
|
]
|
|
|
|
]
|
2020-06-19 00:42:10 +02:00
|
|
|
]
|
|
|
|
);
|