Commit 344ea43b authored by Tristan Olive's avatar Tristan Olive

Fixed delete team function

The remove team link was not working, as it required that all team members be removed first. Fixed so that all but one member must be removed, as that one member must remain in order for the team to be removed! Also, remove the user from the team when removing the team.

parent 7fd2840e
......@@ -182,7 +182,10 @@ function boincteam_assume_foundership($team_id) {
function boincteam_delete($team_id) {
$team = node_load($team_id);
$boincteam = boincteam_load(boincteam_lookup_id($team_id), TRUE);
if ($boincteam->nusers == 0) {
if ($boincteam->nusers == 1) {
$boincuser = boincuser_load();
$team->uid = 0;
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