You are here

function securepages_test in Secure Pages 6

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

Secure Pages SSL Test

1 call to securepages_test()
securepages_settings in ./securepages.admin.inc
Implementation of hook_settings().

File

./securepages.module, line 244
Provide method of creating allowing certain pages to only viewable from https pages

Code

function securepages_test() {

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