Skip to content

Commit

Permalink
MDL-10296 made print_user_picture cater for https possibility in user…
Browse files Browse the repository at this point in the history
…/edit
  • Loading branch information
jmg324 committed Sep 20, 2007
1 parent 1a73060 commit cfbd464
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/weblib.php
Expand Up @@ -3338,11 +3338,17 @@ function print_user_picture($userid, $courseid, $picture, $size=0, $return=false
$file = 'f2';
}
$class = "userpicture";
if (!empty($HTTPSPAGEREQUIRED)) {
$wwwroot = $CFG->httpswwwroot;
} else {
$wwwroot = $CFG->wwwroot;
}

if ($picture) { // Print custom user picture
if ($CFG->slasharguments) { // Use this method if possible for better caching
$src = $CFG->wwwroot .'/user/pix.php/'. $userid .'/'. $file .'.jpg';
$src = $wwwroot .'/user/pix.php/'. $userid .'/'. $file .'.jpg';
} else {
$src = $CFG->wwwroot .'/user/pix.php?file=/'. $userid .'/'. $file .'.jpg';
$src = $wwwroot .'/user/pix.php?file=/'. $userid .'/'. $file .'.jpg';
}
} else { // Print default user pictures (use theme version if available)
$class .= " defaultuserpic";
Expand Down

0 comments on commit cfbd464

Please sign in to comment.