Commit f4d8dc79 authored by Nigel McNie's avatar Nigel McNie
Browse files

Remove users' group memberships when they're deleted. And don't remove groups they're the owner of.

'Owner' is a hangover from the old group stuff anyway. It doesn't make sense to delete a group just because a group admin has been deleted.
parent b8eba97b
......@@ -669,8 +669,10 @@ function delete_user($userid) {
SET email = email || ?
WHERE owner = ?', array($emailsuffix, $userid));
// mark all groups the user owns as deleted
set_field('group', 'deleted', '1', 'owner', $userid);
// Remove user from any groups they're in, invited to or want to be in
delete_records('group_member', 'member', $userid);
delete_records('group_member_request', 'member', $userid);
delete_records('group_member_invite', 'member', $userid);
db_commit();
......
Supports Markdown
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