Commit 1e5d7f8e authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Institution admin can remove a user from another institution (Bug 1190127)"

parents 19aecba0 2ea8383f
......@@ -641,8 +641,19 @@ $elements = array(
),
);
function is_institute_admin($institution) {
return $institution->admin;
}
$institutions = $user->get('institutions');
if ( !$USER->get('admin') ) { // for institution admins
$admin_institutions = $USER->get('institutions');
$admin_institutions = array_filter($admin_institutions, "is_institute_admin");
$institutions = array_intersect_key($institutions, $admin_institutions);
}
$allinstitutions = get_records_assoc('institution', '', '', 'displayname');
foreach ($user->get('institutions') as $i) {
foreach ($institutions as $i) {
$elements[$i->institution.'_settings'] = array(
'type' => 'fieldset',
'legend' => $allinstitutions[$i->institution]->displayname,
......
......@@ -841,7 +841,7 @@ $string['authenticatedbydescription'] = 'How this user authenticates to Mahara';
$string['remoteusername'] = 'Username for external authentication';
$string['remoteusernamedescription1'] = 'If this user signs in to %s from a remote site using an external authentication plugin, this is the username which identifies the user on the remote site.';
$string['institutionsettings'] = 'Institution settings';
$string['institutionsettingsdescription'] = 'Here you can change settings regarding this user\'s membership with institutions in the system.';
$string['institutionsettingsdescription'] = 'Here you can change settings regarding this user\'s membership for institutions you are an administrator of.';
$string['changeinstitution'] = 'Change institution';
$string['institutionstaff'] = 'Institution staff';
$string['institutionadmins'] = 'Institution administrators';
......
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