You are here

function hsts_requirements in HTTP Strict Transport Security 7

Implements hook_requirements().

File

./hsts.module, line 79
Main module file for the HSTS (HTTP Strict Transport Security) module.

Code

function hsts_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    $hsts_https_only = variable_get('hsts_https_only', FALSE);
    $requirements['hsts_https_only'] = array(
      'title' => t('HTTP Strict Transport Security header restriction only to HTTPS'),
      'value' => $hsts_https_only ? t('Enabled') : t('Disabled'),
      'severity' => $hsts_https_only ? REQUIREMENT_OK : REQUIREMENT_WARNING,
    );
  }
  return $requirements;
}