Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

If config wwwroot starts with 'https', ignore config loginhttps value.

Dependency: Bug #5647
  • Loading branch information...
commit ffccc532c65fe569208a0079efa86f371cc67980 1 parent ad6ae2c
ethem authored
4 enrol/authorize/config.html
@@ -47,7 +47,7 @@
47 47 <td><?php print_string("currency") ?>
48 48 </td>
49 49 </tr>
50   -
  50 +<?php if (substr($CFG->wwwroot, 0, 5) !== 'https') { /* https && loginhttps */ ?>
51 51 <tr valign="top">
52 52 <td align="right">loginhttps:</td>
53 53 <td><?php echo (empty($CFG->loginhttps) ? "<font color=\"red\"><b>off</b></font>" : "<font color=\"green\">on</font>") ?></td>
@@ -56,7 +56,7 @@
56 56 print_string("logindesc", "enrol_authorize", $a)
57 57 ?></td>
58 58 </tr>
59   -
  59 +<?php } /* end: https && loginhttps */ ?>
60 60 <tr valign="top"><td colspan="3"><h4><?php print_string("adminauthorizesettings", "enrol_authorize") ?></h4></td></tr>
61 61
62 62 <tr valign="top">
8 enrol/authorize/enrol.php
@@ -451,7 +451,7 @@ function config_form($frm)
451 451 notify('PHP must be compiled with SSL support (--with-openssl)');
452 452 }
453 453
454   - if (empty($CFG->loginhttps)) {
  454 + if (empty($CFG->loginhttps) and substr($CFG->wwwroot, 0, 5) !== 'https') {
455 455 notify('loginhttps must be ON');
456 456 }
457 457
@@ -540,8 +540,10 @@ function process_config($config)
540 540 $tranval = optional_param('an_tran_key', '');
541 541 $passwordval = optional_param('an_password', '');
542 542
543   - if (empty($CFG->loginhttps) || (!$this->check_openssl_loaded()) ||
544   - empty($loginval) || (empty($tranval) && empty($passwordval))) {
  543 + if ((empty($CFG->loginhttps) and substr($CFG->wwwroot, 0, 5) !== 'https') ||
  544 + !$this->check_openssl_loaded() ||
  545 + empty($loginval) ||
  546 + (empty($tranval) and empty($passwordval))) {
545 547 return false;
546 548 }
547 549

0 comments on commit ffccc53

Please sign in to comment.
Something went wrong with that request. Please try again.