Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit fc58c234ed0199efd89f5b7968c3bcd1e1265b97 1 parent 8b0318d
@FMCorz FMCorz authored samhemelryk committed
Showing with 7 additions and 1 deletion.
  1. +7 −1 user/view.php
View
8 user/view.php
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.