new: [cryptographic keys] views added

pull/8213/head
iglocska 2022-03-13 12:39:05 +01:00
parent f74d664ce7
commit b1b32fe1f9
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,48 @@
<?php
echo '<span class="hidden instanceKeyContainer"></span>';
echo $this->element('genericElements/Form/genericForm', [
'data' => [
'description' => __('Add a signing key to be used to validate the origin of event updates. By putting an event into protected mode, the event cannot reliably be propagated to / updated at instances beyond the reach of those that can sign with the listed keys below.'),
'model' => 'CryptographicKey',
'title' => __('Add Cryptographic key'),
'fields' => [
[
'field' => 'type',
'class' => 'span6',
'type' => 'dropdown',
'options' => [
'pgp' => 'PGP'
]
],
[
'field' => 'instance_key',
'type' => 'action',
'class' => 'btn btn-inverse',
'icon' => 'key',
'text' => __('Use the instance\'s signing key'),
'onClick' => 'insertInstanceKey();'
],
[
'field' => 'key_data',
'label' => __('Key contents'),
'type' => 'textarea',
'class' => 'input span6'
],
],
'submit' => [
'action' => $this->request->params['action'],
'ajaxSubmit' => 'submitGenericFormInPlace();'
]
]
]);
if (!$ajax) {
echo $this->element('/genericElements/SideMenu/side_menu', $menuData);
}
?>
<script type="text/javascript">
var instanceKey = <?= json_encode(h($instanceKey)); ?>;
function insertInstanceKey() {
$('#CryptographicKeyKeyData').val(instanceKey);
}
</script>

View File

@ -0,0 +1,18 @@
<?php
echo $this->element(
'genericElements/SingleViews/single_view',
[
'title' => 'Cryptographic key view',
'data' => $data,
'fields' => [
[
'key' => __('type'),
'path' => 'CryptographicKey.type'
],
[
'key' => __('key_data'),
'path' => 'CryptographicKey.key_data'
]
]
]
);