2020-05-29 13:41:58 +02:00
|
|
|
<?php
|
2020-11-06 10:45:00 +01:00
|
|
|
echo $this->element('genericElements/Form/genericForm', [
|
|
|
|
'data' => [
|
2020-06-04 10:05:45 +02:00
|
|
|
'title' => __('Add new encryption key'),
|
2021-06-18 10:46:54 +02:00
|
|
|
'description' => __('Assign encryption keys to the user, used to securely communicate or validate messages coming from the user.'),
|
2020-05-29 13:41:58 +02:00
|
|
|
'model' => 'Organisations',
|
2020-11-06 10:45:00 +01:00
|
|
|
'fields' => [
|
|
|
|
[
|
2021-03-15 22:47:13 +01:00
|
|
|
'field' => 'owner_model',
|
2020-06-04 10:05:45 +02:00
|
|
|
'label' => __('Owner type'),
|
|
|
|
'options' => array_combine(array_keys($dropdownData), array_keys($dropdownData)),
|
|
|
|
'type' => 'dropdown'
|
2020-11-06 10:45:00 +01:00
|
|
|
],
|
|
|
|
[
|
2020-06-04 10:05:45 +02:00
|
|
|
'field' => 'organisation_id',
|
|
|
|
'label' => __('Owner organisation'),
|
2020-11-06 10:45:00 +01:00
|
|
|
'options' => $dropdownData['organisation'] ?? [],
|
2020-06-04 10:05:45 +02:00
|
|
|
'type' => 'dropdown',
|
|
|
|
'stateDependence' => [
|
2021-03-15 22:47:13 +01:00
|
|
|
'source' => '#owner_model-field',
|
2020-06-04 10:05:45 +02:00
|
|
|
'option' => 'organisation'
|
|
|
|
]
|
2020-11-06 10:45:00 +01:00
|
|
|
],
|
|
|
|
[
|
2020-06-04 10:05:45 +02:00
|
|
|
'field' => 'individual_id',
|
|
|
|
'label' => __('Owner individual'),
|
2020-11-06 10:45:00 +01:00
|
|
|
'options' => $dropdownData['individual'] ?? [],
|
2020-06-04 10:05:45 +02:00
|
|
|
'type' => 'dropdown',
|
|
|
|
'stateDependence' => [
|
2021-03-15 22:47:13 +01:00
|
|
|
'source' => '#owner_model-field',
|
2020-06-04 10:05:45 +02:00
|
|
|
'option' => 'individual'
|
|
|
|
]
|
2020-11-06 10:45:00 +01:00
|
|
|
],
|
|
|
|
[
|
2020-05-29 13:41:58 +02:00
|
|
|
'field' => 'uuid',
|
|
|
|
'type' => 'uuid'
|
2020-11-06 10:45:00 +01:00
|
|
|
],
|
|
|
|
[
|
2020-05-29 13:41:58 +02:00
|
|
|
'field' => 'type',
|
2020-11-06 10:45:00 +01:00
|
|
|
'options' => ['pgp' => 'PGP', 'smime' => 'S/MIME'],
|
2020-06-04 10:05:45 +02:00
|
|
|
'type' => 'dropdown'
|
2020-11-06 10:45:00 +01:00
|
|
|
],
|
|
|
|
[
|
2020-05-29 13:41:58 +02:00
|
|
|
'field' => 'encryption_key',
|
|
|
|
'label' => __('Public key'),
|
|
|
|
'type' => 'textarea',
|
|
|
|
'rows' => 8
|
2020-11-06 10:45:00 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'field' => 'revoked',
|
|
|
|
'label' => __('Revoked'),
|
|
|
|
'type' => 'checkbox'
|
|
|
|
]
|
|
|
|
],
|
|
|
|
'submit' => [
|
2020-05-29 13:41:58 +02:00
|
|
|
'action' => $this->request->getParam('action')
|
2020-11-06 10:45:00 +01:00
|
|
|
]
|
|
|
|
]
|
|
|
|
]);
|