You are here

function hsts_install in HTTP Strict Transport Security 6

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

Implements hook_install().

File

./hsts.install, line 11
Install file for the hsts module.

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);

  // Notify the user that extra configuraiton 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 <a href="/?q=admin/settings/hsts">HSTS Configuration</a> page.'), 'info');
}