Permalink
Browse files

MDL-37481 user: fixed bug when logged in as guest

  • Loading branch information...
1 parent 52f0c09 commit 3ecc63e9dbe29c6a5a8f65fa8e7980ba0fffb5a8 @FMCorz FMCorz committed with Sam Hemelryk Mar 3, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 user/view.php
View
@@ -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);

0 comments on commit 3ecc63e

Please sign in to comment.