Skip to content

Commit

Permalink
MDL-37481 user: fixed bug when logged in as guest
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart authored and Sam Hemelryk committed Mar 3, 2013
1 parent 8a407e2 commit 4d32733
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion user/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@
}

if (!empty($CFG->forceloginforprofiles)) {
require_login(); // we can not log in to course due to the parent hack below
require_login(); // We can not log in to course due to the parent hack below.

// Guests do not have permissions to view anyone's profile if forceloginforprofiles is set.
if (isguestuser()) {
$SESSION->wantsurl = $PAGE->url->out(false);
redirect(get_login_url());
}
}

$PAGE->set_context($coursecontext);
Expand Down

0 comments on commit 4d32733

Please sign in to comment.