diff --git a/modules/os2forms_encrypt/src/Form/SettingsForm.php b/modules/os2forms_encrypt/src/Form/SettingsForm.php index 0fd05fc..fd24bef 100644 --- a/modules/os2forms_encrypt/src/Form/SettingsForm.php +++ b/modules/os2forms_encrypt/src/Form/SettingsForm.php @@ -4,6 +4,7 @@ use Drupal\Core\Form\ConfigFormBase; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Link; /** * Class Os2FormsEncryptAdminForm. @@ -37,6 +38,18 @@ public function getFormId(): string { public function buildForm(array $form, FormStateInterface $form_state): array { $config = $this->config('os2forms_encrypt.settings'); + $link = Link::createFromRoute($this->t('administration'), 'entity.key.collection'); + $form['notice'] = [ + '#type' => 'inline_template', + '#template' => '

{{ title }}

{{ message|t }}

{{ adminMessage|t }}

', + '#context' => [ + 'classes' => 'notification', + 'title' => 'Please note', + 'message' => 'The encryption key that comes with this module should not be used and should be changed before encrypting anything.', + 'adminMessage' => 'You can modify the key (named "webform") in the keys ' . $link->toString() . ' panel. Additionally, the execution of this command can generate a new 256-bit key for you:
dd if=/dev/urandom bs=32 count=1 | base64 -i -
', + ], + ]; + $form['enabled'] = [ '#type' => 'checkbox', '#title' => $this->t('Enabled encryption'),