From 8761b0bc4f3e9275b49c1be7a133ce16562d32a9 Mon Sep 17 00:00:00 2001 From: ethem Date: Tue, 30 May 2006 08:32:43 +0000 Subject: [PATCH] If config wwwroot starts with 'https', ignore config loginhttps value. Dependency: Bug #5647; Merged from MOODLE_16_STABLE. --- enrol/authorize/config.html | 4 ++-- enrol/authorize/enrol.php | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/enrol/authorize/config.html b/enrol/authorize/config.html index 5dc0f1c1347..4159e4f0f04 100755 --- a/enrol/authorize/config.html +++ b/enrol/authorize/config.html @@ -47,7 +47,7 @@ if (!isset($frm->acceptccs)) { - +wwwroot, 0, 5) !== 'https') { /* https && loginhttps */ ?> loginhttps: loginhttps) ? "off" : "on") ?> @@ -56,7 +56,7 @@ if (!isset($frm->acceptccs)) { print_string("logindesc", "enrol_authorize", $a) ?> - +

diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index c22995eb59c..256a457602b 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -451,7 +451,7 @@ class enrolment_plugin_authorize notify('PHP must be compiled with SSL support (--with-openssl)'); } - if (empty($CFG->loginhttps)) { + if (empty($CFG->loginhttps) and substr($CFG->wwwroot, 0, 5) !== 'https') { notify('loginhttps must be ON'); } @@ -540,8 +540,10 @@ class enrolment_plugin_authorize $tranval = optional_param('an_tran_key', ''); $passwordval = optional_param('an_password', ''); - if (empty($CFG->loginhttps) || (!$this->check_openssl_loaded()) || - empty($loginval) || (empty($tranval) && empty($passwordval))) { + if ((empty($CFG->loginhttps) and substr($CFG->wwwroot, 0, 5) !== 'https') || + !$this->check_openssl_loaded() || + empty($loginval) || + (empty($tranval) and empty($passwordval))) { return false; }