You are here

function hsts_install in HTTP Strict Transport Security 7

Same name and namespace in other branches
  1. 6 hsts.install \hsts_install()

Implementation of hook_install().

File

./hsts.install, line 12
Install file for hsts.

Code

function hsts_install() {

  // Set the module weight to ensure it is the first module loaded
  db_query("UPDATE {system} SET weight = -999 WHERE name = 'hsts'");
  variable_set('hsts_max_age', 400);
  variable_set('hsts_enabled', FALSE);
  variable_set('hsts_subdomains', FALSE);
  variable_set('hsts_https_only', TRUE);

  // Notify the user that extra configuration is required.
  drupal_set_message(t('HSTS module enabled.'));
  drupal_set_message(t('HSTS headers are not enabled by default. To do so please use the !link page.', array(
    '!link' => l(t('HSTS Configuration'), 'admin/config/security/hsts'),
  )), 'info');
}