You are here

function httprl_fast403 in HTTP Parallel Request & Threading Library 7

Same name and namespace in other branches
  1. 6 httprl.module \httprl_fast403()

Send out a fast 403 and exit.

1 call to httprl_fast403()
httprl_async_page in ./httprl.async.inc
Menu Callback; run given function.

File

./httprl.module, line 2749
HTTP Parallel Request Library module.

Code

function httprl_fast403($msg = '') {
  global $base_path;

  // Set headers.
  if (!headers_sent()) {
    header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
    header('X-HTTPRL: Forbidden.');
  }

  // Print simple 403 page.
  print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n";
  print '<html>';
  print '<head><title>403 Forbidden</title></head>';
  print '<body><h1>Forbidden</h1>';
  print '<p>You are not authorized to access this page.</p>';
  print '<p><a href="' . $base_path . '">Home</a></p>';
  print '<!-- httprl_fast403 ' . $msg . ' -->';
  print '</body></html>';

  // Exit Script.
  httprl_call_exit();
}