Commit 1be55fe1 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Reload institution blogs page to get institution's real name"

parents 3db4ecaf c2d60a96
......@@ -43,6 +43,19 @@ if ($institution = param_alphanum('institution', null)) {
}
else {
$s = institution_selector_for_page($institution, get_config('wwwroot') . 'artefact/blog/index.php');
// Special case: institution=1 means "any institution".
// If it comes back with a different institution than that,
// then reload so we know the institution by name.
// (This makes pagination a lot easier!)
if ($institution == 1 && $s['institution'] != 1) {
if (empty($s['institution'])) {
// we have no institutions yet (only 'mahara')
$s['institution'] = 'mahara';
}
redirect($CFG->wwwroot . 'artefact/blog/index.php?institution=' . $s['institution']);
}
$institutionname = $s['institution'];
if (!($USER->get('admin') || $USER->is_institutional_admin())) {
throw new AccessDeniedException();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment