Commit a7c2a1dc authored by Richard Mansfield's avatar Richard Mansfield

When an admin adds themselves to an institution on admin/user/edit, update immediately

Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 03fa3dad
......@@ -483,7 +483,13 @@ function edituser_institution_submit(Pieform $form, $values) {
if (isset($values['add']) && $USER->get('admin')
&& (empty($userinstitutions) || get_config('usersallowedmultipleinstitutions'))) {
$user->join_institution($values['addinstitution']);
if ($user->id == $USER->id) {
$USER->join_institution($values['addinstitution']);
$USER->commit();
}
else {
$user->join_institution($values['addinstitution']);
}
}
redirect('/admin/users/edit.php?id='.$user->id);
......
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