You are here

function securepages_drupal_goto_alter in Secure Pages 7

Implements hook_drupal_goto_alter().

File

./securepages.module, line 128
Allows certain pages to be viewable only via HTTPS.

Code

function securepages_drupal_goto_alter(&$path, &$options, &$http_response_code) {
  global $is_https, $user;
  if (!variable_get('securepages_enable', 0)) {
    return;
  }
  if (securepages_match($path) || securepages_roles($user)) {
    if (!$is_https) {
      $options['https'] = TRUE;
    }
  }
  elseif ($is_https && variable_get('securepages_switch', FALSE)) {
    $options['https'] = FALSE;
  }
}