Skip to content

Commit

Permalink
Web: when delete a user, delete team_admin entries for that user.
Browse files Browse the repository at this point in the history
Ignore team_admin entries for nonexistent users.
  • Loading branch information
davidpanderson committed Sep 25, 2023
1 parent 99a60c4 commit a7f6b66
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions html/inc/delete_account.inc
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ function wipe_account($user) {
BoincHostAppVersion::delete_for_user($user->id);
BoincHost::delete_for_user($user->id);
BoincConsent::delete_for_user($user->id);
BoincTeamAdmin::delete("userid=$user->id");

// final action
delete_user($user); //from user_util.inc
Expand Down
1 change: 1 addition & 0 deletions html/inc/forum_email.inc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function mail_report_list($forum, $subject, $body, $must_send=false) {
$admins = BoincTeamAdmin::enum("teamid=$team->id");
foreach ($admins as $admin) {
$u = BoincUser::lookup_id($admin->userid);
if (!$u) continue;
$success &= send_email($u, $subject, $body);
}
break;
Expand Down
1 change: 1 addition & 0 deletions html/inc/team.inc
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ function admin_list($teamid) {
$admins = BoincTeamAdmin::enum("teamid=$teamid");
foreach ($admins as $admin) {
$user = BoincUser::lookup_id($admin->userid);
if (!$user) continue;
$u[] = $user;
}
return $u;
Expand Down
1 change: 1 addition & 0 deletions html/user/team_admins.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

function show_admin($user, $admin) {
$admin_user = BoincUser::lookup_id($admin->userid);
if (!$admin_user) return;
$tokens = url_tokens($user->authenticator);
$date = date_str($admin->create_time);
echo "<tr>
Expand Down

0 comments on commit a7f6b66

Please sign in to comment.