Commit bf3143cc authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1840713: Allow 'mahara' institution to populate institution admin list page



behatnotneeded

Change-Id: Ibfa1bc41bb60ad90b69aee8715ab3581c4ed5882
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 6ff33511
......@@ -25,14 +25,20 @@ if (is_isolated() && !in_array($inst, array_keys($USER->get('institutions'))) &&
throw new AccessDeniedException(get_string('notinstitutionmember', 'error'));
}
$institution = new Institution($inst);
try {
$institution = new Institution($inst);
}
catch (Exception $e) {
throw new NotFoundException(get_string('institutionnotfound', 'mahara', $inst));
}
$admins = $institution->admins();
$staff = $institution->staff();
build_stafflist_html($admins, 'institution', 'admin', $inst);
build_stafflist_html($staff, 'institution', 'staff', $inst);
define('TITLE', $institution->displayname);
$displayname = $institution->name == 'mahara' ? get_config('sitename') : $institution->displayname;
define('TITLE', $displayname);
$smarty = smarty();
$smarty->assign('admins', $admins);
......
......@@ -492,6 +492,7 @@ $string['senddeletenotification'] = 'Send request';
$string['javascriptnotenabled'] = 'Your browser does not have JavaScript enabled. This site requires JavaScript to be enabled before you can log in.';
$string['cookiesnotenabled'] = 'Your browser does not have cookies enabled or is blocking cookies. This site requires cookies to be enabled before you can log in.';
$string['institution'] = 'Institution';
$string['institutionnotfound'] = 'Institution "%s" not found';
$string['institutioncontacts'] = '\'%s\' contacts';
$string['institutionlink'] = '<a href="%s">%s</a>';
$string['link'] = '<a href="%s">%s</a>';
......
......@@ -799,6 +799,9 @@ class Institution {
WHERE i.institution = ? AND u.deleted = 0 AND i.admin = 1', array($this->name))) {
return array_map('extract_institution_user_id', $results);
}
if ($this->name == 'mahara') {
return $this->institution_and_site_admins();
}
return array();
}
......
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