You are here

hsts.install in HTTP Strict Transport Security 6

Same filename and directory in other branches
  1. 7 hsts.install

Install file for the hsts module.

File

hsts.install
View source
<?php

/**
 * @file
 * Install file for the hsts module.
 */

/**
 * Implements hook_install().
 */
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');
}

/**
 * Implements hook_uninstall().
 */
function hsts_uninstall() {
  variable_del('hsts_max_age');
  variable_del('hsts_enabled');
  variable_del('hsts_subdomains');
}

Functions

Namesort descending Description
hsts_install Implements hook_install().
hsts_uninstall Implements hook_uninstall().