]> git.mjollnir.org Git - moodle.git/commitdiff
fixed problem when set both loginhttps and https in wwwroot, closes bug #5507 and...
authorskodak <skodak>
Mon, 15 May 2006 21:36:46 +0000 (21:36 +0000)
committerskodak <skodak>
Mon, 15 May 2006 21:36:46 +0000 (21:36 +0000)
12 files changed:
auth/cas/login.php
lib/moodlelib.php
lib/weblib.php
mod/chat/view.php
mod/forum/markposts.php
mod/forum/post.php
mod/forum/settracking.php
mod/forum/subscribe.php
mod/quiz/view.php
my/index.php
user/tabs.php
user/view.php

index ba86d7598b2fb0dd3d0db15f4482545ee8f9d58e..36cfd6977592e5b42e11c64ce2d805579ddb422c 100644 (file)
@@ -18,7 +18,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.');
         if (empty($CFG->loginhttps)) {
             $wwwroot = $CFG->wwwroot;
         } else {
-            $wwwroot = str_replace('http','https',$CFG->wwwroot);
+            $wwwroot = str_replace('http:','https:',$CFG->wwwroot);
         }
         $langmenu = popup_form ("$wwwroot/login/index.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
     }
index 576da03c5ea23a351fdaa51bc1e0737af07e8c75..88deb9bdf6a747b656f623a6fac53fb006b1704d 100644 (file)
@@ -1525,7 +1525,7 @@ function require_login($courseid=0, $autologinguest=true, $cm=null) {
         if (empty($CFG->loginhttps)) {
             redirect($CFG->wwwroot .'/login/index.php'. $loginguest);
         } else {
-            $wwwroot = str_replace('http','https', $CFG->wwwroot);
+            $wwwroot = str_replace('http:','https:', $CFG->wwwroot);
             redirect($wwwroot .'/login/index.php'. $loginguest);
         }
         exit;
index 16231e780f2aebc90462288848f94acdff245c97..3f9dfb3b648a1b07be4d5a70847e30af3623603a 100644 (file)
@@ -1906,11 +1906,11 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $meta=
 
 /// We have to change some URLs in styles if we are in a $HTTPSPAGEREQUIRED page
     if (!empty($HTTPSPAGEREQUIRED)) {
-        $CFG->themewww = str_replace('http', 'https', $CFG->themewww);
-        $CFG->pixpath = str_replace('http', 'https', $CFG->pixpath);
-        $CFG->modpixpath = str_replace('http', 'https', $CFG->modpixpath);
+        $CFG->themewww = str_replace('http:', 'https:', $CFG->themewww);
+        $CFG->pixpath = str_replace('http:', 'https:', $CFG->pixpath);
+        $CFG->modpixpath = str_replace('http:', 'https:', $CFG->modpixpath);
         foreach ($CFG->stylesheets as $key => $stylesheet) {
-            $CFG->stylesheets[$key] = str_replace('http', 'https', $stylesheet);
+            $CFG->stylesheets[$key] = str_replace('http:', 'https:', $stylesheet);
         }
     }
 
@@ -1945,7 +1945,7 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $meta=
         if (empty($CFG->loginhttps)) {
             $wwwroot = $CFG->wwwroot;
         } else {
-            $wwwroot = str_replace('http','https',$CFG->wwwroot);
+            $wwwroot = str_replace('http:','https:',$CFG->wwwroot);
         }
         if (isset($course->id)) {
             $menu = user_login_string($course);
@@ -2430,7 +2430,7 @@ function user_login_string($course=NULL, $user=NULL) {
     if (empty($CFG->loginhttps)) {
         $wwwroot = $CFG->wwwroot;
     } else {
-        $wwwroot = str_replace('http','https',$CFG->wwwroot);
+        $wwwroot = str_replace('http:','https:',$CFG->wwwroot);
     }
 
     if (isset($user->id) and $user->id) {
index e6f73a1279d8672aac42a2fbfcc950ae82ecd1a2..d908c3714fbe2f24e700b2d849e517ec3f256257 100644 (file)
 
         $wwwroot = $CFG->wwwroot.'/login/index.php';
         if (!empty($CFG->loginhttps)) {
-            $wwwroot = str_replace('http','https', $wwwroot);
+            $wwwroot = str_replace('http:','https:', $wwwroot);
         }
 
         notice_yesno(get_string('noguests', 'chat').'<br /><br />'.get_string('liketologin'),
index 45cb80f3353e4393c121850c9ab7afeea5cbef8b..933ff38c41d545262eca9da0436785197873c396 100644 (file)
@@ -29,7 +29,7 @@
     if (isguest()) {   // Guests can't change forum
         $wwwroot = $CFG->wwwroot.'/login/index.php';
         if (!empty($CFG->loginhttps)) {
-            $wwwroot = str_replace('http','https', $wwwroot);
+            $wwwroot = str_replace('http:','https:', $wwwroot);
         }
 
         $strforums = get_string('modulenameplural', 'forum');
index df7800890345f53469b1fec06082517e43e46e09..d420360fa44b20635628b5a2d8eb65a8d06ff55d 100644 (file)
@@ -16,7 +16,7 @@
     if (isguest()) {
         $wwwroot = $CFG->wwwroot.'/login/index.php';
         if (!empty($CFG->loginhttps)) {
-            $wwwroot = str_replace('http','https', $wwwroot);
+            $wwwroot = str_replace('http:','https:', $wwwroot);
         }
 
         if (isset($forum)) {      // User is starting a new discussion in a forum
index 111452b0da2f3b2dee3130f99c0c99c16132adff..8acd9a8df50d73470c15df90ce63b1aa8d58027a 100644 (file)
@@ -27,7 +27,7 @@
     if (isguest()) {   // Guests can't change tracking
         $wwwroot = $CFG->wwwroot.'/login/index.php';
         if (!empty($CFG->loginhttps)) {
-            $wwwroot = str_replace('http','https', $wwwroot);
+            $wwwroot = str_replace('http:','https:', $wwwroot);
         }
 
         $strforums = get_string('modulenameplural', 'forum');
index 323f299c8dceb8119e68f3f40eeeadde0de30c66..ad8d1d7c1873763b6718d4d7d4ecb60092a8da8b 100644 (file)
@@ -43,7 +43,7 @@
     if (isguest()) {   // Guests can't subscribe
         $wwwroot = $CFG->wwwroot.'/login/index.php';
         if (!empty($CFG->loginhttps)) {
-            $wwwroot = str_replace('http','https', $wwwroot);
+            $wwwroot = str_replace('http:','https:', $wwwroot);
         }
 
         $strforums = get_string('modulenameplural', 'forum');
index d408728d3c346f35f36ba8c2203ad759fb3c8cb2..e79c92bf00da8c153fcbd7d6719aadb8ec5e9761 100644 (file)
 
         $wwwroot = $CFG->wwwroot.'/login/index.php';
         if (!empty($CFG->loginhttps)) {
-            $wwwroot = str_replace('http','https', $wwwroot);
+            $wwwroot = str_replace('http:','https:', $wwwroot);
         }
 
         notice_yesno(get_string('guestsno', 'quiz').'<br /><br />'.get_string('liketologin'),
index 00e4fab6c479d4412e91c5d148074c9900e28dd5..de6ca4653d885051f1017f1ab8781bda48629bef 100644 (file)
@@ -14,7 +14,7 @@
     if (isguest()) {
         $wwwroot = $CFG->wwwroot.'/login/index.php';
         if (!empty($CFG->loginhttps)) {
-            $wwwroot = str_replace('http','https', $wwwroot);
+            $wwwroot = str_replace('http:','https:', $wwwroot);
         }
 
         print_header($mymoodlestr);
index ae5c04423f4dae20413c8497608ff4d53af7678a..85dd670723ad456f4509ff4399f9a465beb6ed70 100644 (file)
@@ -93,7 +93,7 @@
             if(empty($CFG->loginhttps)) {
                 $wwwroot = $CFG->wwwroot;
             } else {
-                $wwwroot = str_replace('http','https',$CFG->wwwroot);
+                $wwwroot = str_replace('http:','https:',$CFG->wwwroot);
             }
 
             $toprow[] = new tabobject('editprofile', $wwwroot.'/user/edit.php?id='.$user->id.'&amp;course='.$course->id, get_string('editmyprofile'));
index 90adf252c99b846333ea2a31c3b6c74752ae0a45..44ef0f38e95126a2c3fc2b9d22e743f2653d5289 100644 (file)
         if (empty($CFG->loginhttps)) {
             $internalpassword = "$CFG->wwwroot/login/change_password.php";
         } else {
-            $internalpassword = str_replace('http','https',$CFG->wwwroot.'/login/change_password.php');
+            $internalpassword = str_replace('http:','https:',$CFG->wwwroot.'/login/change_password.php');
         }
     }