From ccf26f8b107087d51ee0777d5362e3a832a1114c Mon Sep 17 00:00:00 2001 From: azammitdcarf Date: Mon, 21 Feb 2011 01:50:55 +0000 Subject: [PATCH] Determine if accessing by http or https for default configuration --- config.default.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/config.default.php b/config.default.php index 3c0ac880..ea322909 100644 --- a/config.default.php +++ b/config.default.php @@ -129,15 +129,22 @@ if (!defined('LIME_AUTO_ADVANCE')) define('LIME_AUTO_ADVANCE', true); */ if (!defined('QUEXS_PATH')) define('QUEXS_PATH', '/quexs/'); +$protocol = "http://"; + +if (!empty($_SERVER['HTTPS'])) +{ + $protocol = "https://"; +} + /** * The complete URL to limesurvey */ -if (!defined('LIME_URL')) define('LIME_URL','http://' . $_SERVER['SERVER_NAME'] . QUEXS_PATH . LIME_PATH); +if (!defined('LIME_URL')) define('LIME_URL', $protocol . $_SERVER['SERVER_NAME'] . QUEXS_PATH . LIME_PATH); /** * The complete URL to this copy of queXS */ -if (!defined('QUEXS_URL')) define('QUEXS_URL','http://' . $_SERVER['SERVER_NAME'] . QUEXS_PATH); +if (!defined('QUEXS_URL')) define('QUEXS_URL', $protocol . $_SERVER['SERVER_NAME'] . QUEXS_PATH); /** * The default locale (language)