You are here

function hsts_admin_settings_form in HTTP Strict Transport Security 6

Same name and namespace in other branches
  1. 7 hsts.admin.inc \hsts_admin_settings_form()

Implements hook_form().

Settings form

1 string reference to 'hsts_admin_settings_form'
hsts_menu in ./hsts.module
Implements hook_menu().

File

./hsts.admin.inc, line 13
Admininstrative forms for hsts module.

Code

function hsts_admin_settings_form() {
  $form = array();
  $form['hsts_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable HTTP Strict Transport Security'),
    '#description' => t('Whether to start adding the HSTS header information or not.'),
    '#default_value' => variable_get('hsts_enabled', FALSE),
  );
  $form['hsts_max_age'] = array(
    '#type' => 'textfield',
    '#title' => t('Max Age'),
    '#description' => t('The maximum age value for the header in seconds. See the <a href="http://lists.w3.org/Archives/Public/www-archive/2009Sep/att-0051/draft-hodges-strict-transport-sec-05.plain.html#syntax">Strict Transport Security Definition</a> for more information.'),
    '#default_value' => variable_get('hsts_max_age', 500),
    '#maxlength' => 9,
    '#size' => 11,
  );
  $form['hsts_subdomains'] = array(
    '#type' => 'checkbox',
    '#title' => t('Include subdomains'),
    '#description' => t('Whether to include the subdomains as part of the HSTS implementation.'),
    '#default_value' => variable_get('hsts_subdomains', FALSE),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  return system_settings_form($form);
}