diff --git a/help.php b/help.php index 8bca3cec706a1..9ab61c08dc8ab 100644 --- a/help.php +++ b/help.php @@ -23,6 +23,27 @@ $PAGE->set_course($COURSE); +$url = new moodle_url($CFG->wwwroot.'/help.php'); +if ($file !== '') { + $url->param('file', $file); +} +if ($text !== 'No text to display') { + $url->param('text', $text); +} +if ($module !== 'moodle') { + $url->param('module', $module); +} +if ($forcelang !== '') { + $url->param('forcelang', $forcelang); +} +if ($skiplocal !== 0) { + $url->param('skiplocal', $skiplocal); +} +if ($fortooltip !== 0) { + $url->param('fortooltip', $fortooltip); +} +$PAGE->set_url($url); + // We look for the help to display in lots of different places, and // only display an error at the end if we can't find the help file // anywhere. This variable tracks that. @@ -93,6 +114,7 @@ } // Do the main output. +$PAGE->set_generaltype('popup'); $PAGE->set_title($title); echo $OUTPUT->header(); echo $OUTPUT->box_start(); diff --git a/index.php b/index.php index 6a3c0f5fb50c3..1caf8bef33dd2 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,4 @@ -frontpageloggedin)) { + if (isloggedin() and !isguestuser() and isset($CFG->frontpageloggedin)) { $frontpagelayout = $CFG->frontpageloggedin; } else { $frontpagelayout = $CFG->frontpage; @@ -176,10 +176,10 @@ case FRONTPAGECOURSELIST: - if (isloggedin() and !has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)) and !isguest() and empty($CFG->disablemycourses)) { + if (isloggedin() and !has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)) and !isguestuser() and empty($CFG->disablemycourses)) { echo $OUTPUT->heading(get_string('mycourses'), 2, 'headingblock header'); print_my_moodle(); - } else if ((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)) and !isguest()) or ($DB->count_records('course') <= FRONTPAGECOURSELIMIT)) { + } else if ((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)) and !isguestuser()) or ($DB->count_records('course') <= FRONTPAGECOURSELIMIT)) { // admin should not see list of courses when there are too many of them echo $OUTPUT->heading(get_string('availablecourses'), 2, 'headingblock header'); print_courses(0); diff --git a/lib/javascript-static.js b/lib/javascript-static.js index a6de9fbffde83..596104370d91d 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -830,7 +830,7 @@ function openpopup(event, args) { if (!windowobj) { return true; } - if (fullscreen) { + if (args.fullscreen) { windowobj.moveTo(0,0); windowobj.resizeTo(screen.availWidth,screen.availHeight); } diff --git a/user/index.php b/user/index.php index ef82d70735057..8a24aa7abe808 100644 --- a/user/index.php +++ b/user/index.php @@ -771,7 +771,7 @@ if (!empty($user->role)) { $row->cells[1]->text .= get_string('role') .': '. $user->role .'
'; } - if ($user->maildisplay == 1 or ($user->maildisplay == 2 and ($course->id != SITEID) and !isguest()) or + if ($user->maildisplay == 1 or ($user->maildisplay == 2 and ($course->id != SITEID) and !isguestuser()) or has_capability('moodle/course:viewhiddenuserfields', $context)) { $link = new html_link(); $link->url = "mailto:$user->email"; diff --git a/user/view.php b/user/view.php index 6f31b2d8ebb0a..3b70fb19bfad6 100644 --- a/user/view.php +++ b/user/view.php @@ -289,7 +289,7 @@ } if ($user->maildisplay == 1 or - ($user->maildisplay == 2 and ($course->id != SITEID) and !isguest()) or + ($user->maildisplay == 2 and ($course->id != SITEID) and !isguestuser()) or has_capability('moodle/course:useremail', $coursecontext)) { $emailswitch = ''; @@ -536,7 +536,7 @@ echo ''; } -if (!$user->deleted and !empty($CFG->messaging) and !isguest() and has_capability('moodle/site:sendmessage', $systemcontext)) { +if (!$user->deleted and !empty($CFG->messaging) and !isguestuser() and has_capability('moodle/site:sendmessage', $systemcontext)) { if (!empty($USER->id) and ($USER->id == $user->id)) { if ($countmessages = $DB->count_records('message', array('useridto'=>$user->id))) { $messagebuttonname = get_string("messages", "message")."($countmessages)"; diff --git a/userpix/index.php b/userpix/index.php index 24454189abc07..50ac819ed1126 100644 --- a/userpix/index.php +++ b/userpix/index.php @@ -1,4 +1,4 @@ -set_url(new moodle_url($CFG->wwwroot.'/userpix/index.php')); + require_login(); /// Remove the following three lines if you want everyone to access it diff --git a/userpix/upgrade.php b/userpix/upgrade.php index fe1cd6c85a5d2..b0ba57b8a41fb 100644 --- a/userpix/upgrade.php +++ b/userpix/upgrade.php @@ -1,10 +1,12 @@ -set_url(new moodle_url($CFG->wwwroot.'/userpix/upgrade.php')); + require_login(); require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));