From e920fe34ef16d30af0f4fb8e33b565e572ab30c8 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 5 Nov 2010 19:05:02 +0000 Subject: - Patch #575280 by mfb, carlos8f, chx, bleen18: impersonation when an https session exists. --- modules/simpletest/tests/http.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 modules/simpletest/tests/http.php (limited to 'modules/simpletest/tests/http.php') diff --git a/modules/simpletest/tests/http.php b/modules/simpletest/tests/http.php new file mode 100644 index 000000000..0c5f1eb78 --- /dev/null +++ b/modules/simpletest/tests/http.php @@ -0,0 +1,33 @@ + $value) { + $_SERVER[$key] = str_replace('modules/simpletest/tests/http.php', 'index.php', $value); + $_SERVER[$key] = str_replace('https://', 'http://', $_SERVER[$key]); +} + +// Change current directory to the Drupal root. +chdir('../../..'); +define('DRUPAL_ROOT', getcwd()); +require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; + +// Make sure this file can only be used by simpletest. +drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION); +if (!drupal_valid_test_ua()) { + header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); + exit; +} + +drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); +menu_execute_active_handler(); -- cgit v1.2.3