You are here

function securepages_goto in Secure Pages 5

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

securepage_goto()

Redirects the current page to the secure or insecure version.

Parameters

$secure: Determine which version of the set to move to.

1 call to securepages_goto()
securepages_init in ./securepages.module
Implementation of hook_init()

File

./securepages.module, line 176

Code

function securepages_goto($secure) {
  $path = !empty($_REQUEST['q']) ? $_REQUEST['q'] : '';
  $query = count($_GET) > 1 ? securepages_get_query($_GET) : NULL;
  $url = securepages_url($path, $query, NULL, $secure);
  if (function_exists('module_invoke_all')) {
    foreach (module_implements('exit') as $module) {
      if ($module != 'devel') {
        module_invoke($module, 'exit');
      }
    }
  }
  else {
    bootstrap_invoke_all('exit');
  }
  header('Location: ' . $url);
  exit;
}