You are here

function securitytxt_sign_form in Security.txt 7

Security.txt sign configuration form.

1 string reference to 'securitytxt_sign_form'
securitytxt_menu in ./securitytxt.module
Implements hook_menu().

File

./securitytxt.admin.inc, line 185

Code

function securitytxt_sign_form() {
  $settings = variable_get('securitytxt');
  if (!$settings['enabled']) {
    $form['instructions'] = array(
      '#type' => 'markup',
      '#markup' => '<p>' . t('You must <a href="@configure">configure and enable</a> your security.txt file before you can sign it.', array(
        '@configure' => url('admin/config/system/securitytxt'),
      )) . '</p>',
    );
    return $form;
  }
  $form['instructions'] = array(
    '#type' => 'markup',
    '#markup' => t('<ol><li><a href="@download" download="security.txt">Download</a> your security.txt file.</li><li><p>Sign your security.txt file with the encryption key you specified in your security.txt file. You can do this with GPG with a command like:</p><p><kbd>gpg -u KEYID --output security.txt.sig  --armor --detach-sig security.txt</kbd></p></li><li>Paste the contents of the <kbd>security.txt.sig</kbd> file into the text box below.</li></ol>', array(
      '@download' => '/.well-known/security.txt',
    )),
  );
  $form['signature_text'] = array(
    '#type' => 'textarea',
    '#title' => t('Signature'),
    '#default_value' => $settings['signature_text'],
    '#rows' => 20,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  return $form;
}