Skip to content

Commit

Permalink
Merge branch 's11_MDL-27866_pix_url_20' of git://github.com/dongsheng…
Browse files Browse the repository at this point in the history
…/moodle into MOODLE_20_STABLE
  • Loading branch information
Sam Hemelryk committed Jun 28, 2011
2 parents e786326 + 945df69 commit 8c75bb5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pluginfile.php
Expand Up @@ -294,6 +294,9 @@
// ======================================================================================================================== // ========================================================================================================================
} else if ($component === 'user') { } else if ($component === 'user') {
if ($filearea === 'icon' and $context->contextlevel == CONTEXT_USER) { if ($filearea === 'icon' and $context->contextlevel == CONTEXT_USER) {
// XXX: pix_url will initialize $PAGE, so we have to set up context here
// this temp hack should be fixed by better solution
$PAGE->set_context(get_system_context());
if (!empty($CFG->forcelogin) and !isloggedin()) { if (!empty($CFG->forcelogin) and !isloggedin()) {
// protect images if login required and not logged in; // protect images if login required and not logged in;
// do not use require_login() because it is expensive and not suitable here anyway // do not use require_login() because it is expensive and not suitable here anyway
Expand Down

0 comments on commit 8c75bb5

Please sign in to comment.