From e77bbbe5b38aeae2dc02ec90c63abf977d4d86eb Mon Sep 17 00:00:00 2001 From: ethem Date: Tue, 30 May 2006 08:50:36 +0000 Subject: [PATCH] If config wwwroot starts with 'https', ignore config loginhttps value. Dependency: Bug #5647 --- enrol/authorize/config.html | 2 ++ enrol/authorize/enrol.php | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/enrol/authorize/config.html b/enrol/authorize/config.html index 96a69a96acf..43d5dc592c7 100755 --- a/enrol/authorize/config.html +++ b/enrol/authorize/config.html @@ -28,6 +28,7 @@ +wwwroot, 0, 5) !== 'https') { /* https && loginhttps */ ?> loginhttps: @@ -40,6 +41,7 @@ ?> +
diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index 9ed2a73213d..cec2adc7b57 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -345,8 +345,8 @@ class enrolment_plugin extends enrolment_base { if (empty($frm->an_tran_key) && empty($frm->an_password)) { notify("an_tran_key or an_password required"); } - if (empty($CFG->loginhttps)) { - notify("\$CFG->loginhttps must be ON"); + if (empty($CFG->loginhttps) and substr($CFG->wwwroot, 0, 5) !== 'https') { + notify("loginhttps must be ON"); } } @@ -360,8 +360,8 @@ class enrolment_plugin extends enrolment_base { function process_config($config) { global $CFG; - if (empty($CFG->loginhttps) || !$this->check_openssl_loaded()) - { + if ((empty($CFG->loginhttps) and substr($CFG->wwwroot, 0, 5) !== 'https') || + !$this->check_openssl_loaded()) { return false; }