You are here

function securepages_test in Secure Pages 7

Same name and namespace in other branches
  1. 5 securepages.module \securepages_test()
  2. 6.2 securepages.module \securepages_test()
  3. 6 securepages.module \securepages_test()

Secure Pages SSL Test.

1 call to securepages_test()
securepages_settings in ./securepages.admin.inc
Builds the securepages settings form.

File

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

Code

function securepages_test() {
  global $is_https;

  // If we are in an SSL page then assume that SSL is configured correctly.
  if ($is_https) {
    return TRUE;
  }
  $url = 'https://' . preg_replace(';^http[s]?://;s', '', url('admin/config/system/securepages/test', array(
    'absolute' => TRUE,
  )));
  $response = drupal_http_request($url);
  return $response->code == 200 ? TRUE : FALSE;
}