mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-32688 My Moodle - Fixed fatal error in guest access to My Moodle
This commit is contained in:
parent
c8ac480979
commit
613921c6bf
1 changed files with 7 additions and 5 deletions
12
my/index.php
12
my/index.php
|
@ -81,11 +81,13 @@ $PAGE->set_subpage($currentpage->id);
|
|||
$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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue