Skip to content

Commit

Permalink
MDL-32688 My Moodle - Fixed fatal error in guest access to My Moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
itamart committed Sep 14, 2012
1 parent c8ac480 commit 613921c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions my/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@
$PAGE->set_title($header);
$PAGE->set_heading($header);

if (get_home_page() != HOMEPAGE_MY) {
if (optional_param('setdefaulthome', false, PARAM_BOOL)) {
set_user_preference('user_home_page_preference', HOMEPAGE_MY);
} else if (!empty($CFG->defaulthomepage) && $CFG->defaulthomepage == HOMEPAGE_USER) {
$PAGE->settingsnav->get('usercurrentsettings')->add(get_string('makethismyhome'), new moodle_url('/my/', array('setdefaulthome'=>true)), navigation_node::TYPE_SETTING);
if (!isguestuser()) { // Skip default home page for guests
if (get_home_page() != HOMEPAGE_MY) {
if (optional_param('setdefaulthome', false, PARAM_BOOL)) {
set_user_preference('user_home_page_preference', HOMEPAGE_MY);
} else if (!empty($CFG->defaulthomepage) && $CFG->defaulthomepage == HOMEPAGE_USER) {
$PAGE->settingsnav->get('usercurrentsettings')->add(get_string('makethismyhome'), new moodle_url('/my/', array('setdefaulthome'=>true)), navigation_node::TYPE_SETTING);
}
}
}

Expand Down

0 comments on commit 613921c

Please sign in to comment.