You are here

function securelogin_url_outbound_alter in Secure Login 7

Implements hook_url_outbound_alter().

File

./securelogin.module, line 158
Enables user login and other forms to be submitted securely via HTTPS.

Code

function securelogin_url_outbound_alter(&$path, &$options, $original_path) {
  global $base_insecure_url, $base_secure_url;

  // Modules and themes may set the 'https' option to TRUE to generate HTTPS
  // URLs or FALSE to generate HTTP URLs.
  if (!isset($options['https'])) {
    return;
  }
  if (isset($options['base_url'])) {
    $options['base_url'] = $options['https'] ? str_replace('http://', 'https://', $options['base_url']) : str_replace('https://', 'http://', $options['base_url']);
  }
  else {
    $options['base_url'] = $options['https'] ? variable_get('securelogin_base_url', $base_secure_url) : $base_insecure_url;
  }
  $options['absolute'] = TRUE;
}