MDL-10296 made print_user_picture cater for https possibility in user/edit
authorjmg324 <jmg324>
Thu, 20 Sep 2007 09:18:24 +0000 (09:18 +0000)
committerjmg324 <jmg324>
Thu, 20 Sep 2007 09:18:24 +0000 (09:18 +0000)
lib/weblib.php

index 6d32b520b981adf2a7f972ee0813c46df484432f..75788f128d280dc4ea07737f3720c6606ffa0557 100644 (file)
@@ -3768,7 +3768,11 @@ function print_user_picture($user, $courseid, $picture=NULL, $size=0, $return=fa
         $file = 'f2';
     }
     $class = "userpicture";
-
+    if (!empty($HTTPSPAGEREQUIRED)) {
+        $wwwroot = $CFG->httpswwwroot;
+    } else {
+        $wwwroot = $CFG->wwwroot;
+    } 
 
     if (is_null($picture)) {
         $picture = $user->picture;
@@ -3776,9 +3780,9 @@ function print_user_picture($user, $courseid, $picture=NULL, $size=0, $return=fa
     
     if ($picture) {  // Print custom user picture
         if ($CFG->slasharguments) {        // Use this method if possible for better caching
-            $src =  $CFG->wwwroot .'/user/pix.php/'. $user->id .'/'. $file .'.jpg';
+            $src =  $wwwroot .'/user/pix.php/'. $user->id .'/'. $file .'.jpg';
         } else {
-            $src =  $CFG->wwwroot .'/user/pix.php?file=/'. $user->id .'/'. $file .'.jpg';
+            $src =  $wwwroot .'/user/pix.php?file=/'. $user->id .'/'. $file .'.jpg';
         }
     } else {         // Print default user pictures (use theme version if available)
         $class .= " defaultuserpic";