Commit 1359c815 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Delete host and authinstance records for an institution before deleting the institution

parent c9a00d06
......@@ -77,7 +77,14 @@ if ($institution || $add) {
function delete_submit(Pieform $form, $values) {
global $SESSION;
$authinstanceids = get_column('auth_instance', 'id', 'institution', $values['i']);
db_begin();
foreach ($authinstanceids as $id) {
delete_records('auth_instance_config', 'instance', $id);
}
delete_records('auth_instance', 'institution', $values['i']);
delete_records('host', 'institution', $values['i']);
delete_records('institution_locked_profile_field', 'name', $values['i']);
delete_records('usr_institution_request', 'institution', $values['i']);
delete_records('institution', 'name', $values['i']);
......
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