Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bump. Now login page is 100% HTTPS if required.

  • Loading branch information...
commit 5e7012bc326653bdd4741d261986778df413d134 1 parent 8fdba9a
stronk7 authored
Showing with 4 additions and 6 deletions.
  1. +4 −6 login/index.php
View
10 login/index.php
@@ -4,6 +4,9 @@
$loginguest = optional_param('loginguest', false); // determines whether visitors are logged in as guest automatically
+ //HTTPS is potentially required in this page
+ httpsrequired();
+
/// Check if the guest user exists. If not, create one.
if (! record_exists("user", "username", "guest")) {
$guest->auth = "manual";
@@ -48,12 +51,7 @@
} else {
$currlang = current_language();
$langs = get_list_of_languages();
- if (empty($CFG->loginhttps)) {
- $wwwroot = $CFG->wwwroot;
- } else {
- $wwwroot = str_replace('http','https',$CFG->wwwroot);
- }
- $langmenu = popup_form ("$wwwroot/login/index.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
+ $langmenu = popup_form ("$CFG->httpswwwroot/login/index.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
}
$loginsite = get_string("loginsite");
Please sign in to comment.
Something went wrong with that request. Please try again.