diff --git a/html/user/team_quit_action.php b/html/user/team_quit_action.php index 4c746440b7..5e6096061c 100644 --- a/html/user/team_quit_action.php +++ b/html/user/team_quit_action.php @@ -40,7 +40,7 @@ page_head("Quit $team_name"); echo "

Removed from team

"; echo "You have been removed from id>$team_name"; - if (!$new_nusers) { + if ($new_nusers <= 0) { echo "

Since you were the last member of the team, it has been disbanded."; } } else { diff --git a/html/user/team_remove_inactive_action.php b/html/user/team_remove_inactive_action.php index 091d5ca9dc..6c4724f9d9 100644 --- a/html/user/team_remove_inactive_action.php +++ b/html/user/team_remove_inactive_action.php @@ -1,4 +1,4 @@ -nusers - $nmembers; - $query = "update team set nusers = $new_nusers where id = $team->id"; + $new_nusers = $team->nusers - $nmembers; + if ($new_nusers > 0) { + $query = "update team set nusers = $new_nusers where id = $team->id"; + } else { + $query = "remove team where id=$team->id"; + echo "

The team has been disbanded because there are no more members."; + } $result = mysql_query($query); page_tail(); -?> +} ?>