]> git.mjollnir.org Git - moodle.git/commitdiff
If config wwwroot starts with 'https', ignore config loginhttps value.
authorethem <ethem>
Tue, 30 May 2006 08:32:43 +0000 (08:32 +0000)
committerethem <ethem>
Tue, 30 May 2006 08:32:43 +0000 (08:32 +0000)
Dependency: Bug #5647; Merged from MOODLE_16_STABLE.

enrol/authorize/config.html
enrol/authorize/enrol.php

index 5dc0f1c1347c19ab31fe70b64e60be8654d4ce19..4159e4f0f042df72c322b3fb2fa54540737dba7e 100755 (executable)
@@ -47,7 +47,7 @@ if (!isset($frm->acceptccs)) {
     <td><?php print_string("currency") ?>
     </td>
 </tr>
-
+<?php if (substr($CFG->wwwroot, 0, 5) !== 'https') { /* https && loginhttps */ ?>
 <tr valign="top">
     <td align="right">loginhttps:</td>
     <td><?php echo (empty($CFG->loginhttps) ? "<font color=\"red\"><b>off</b></font>" : "<font color=\"green\">on</font>") ?></td>
@@ -56,7 +56,7 @@ if (!isset($frm->acceptccs)) {
     print_string("logindesc", "enrol_authorize", $a)
     ?></td>
 </tr>
-
+<?php } /* end: https && loginhttps */ ?>
 <tr valign="top"><td colspan="3"><h4><?php print_string("adminauthorizesettings", "enrol_authorize") ?></h4></td></tr>
 
 <tr valign="top">
index c22995eb59c78dbe97c42ee30aaab173fa8330b6..256a457602b83c550134fff4ff2e7ce6bff81104 100755 (executable)
@@ -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;
         }