2002-08-07 18:56:55 +00:00
|
|
|
<?php
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/db.inc");
|
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/team.inc");
|
2002-08-07 18:56:55 +00:00
|
|
|
|
|
|
|
db_init();
|
2003-03-19 21:01:32 +00:00
|
|
|
$user = get_logged_in_user();
|
2004-01-15 21:24:55 +00:00
|
|
|
$teamid = $_POST["id"];
|
2004-01-14 20:24:24 +00:00
|
|
|
$team = lookup_team($teamid);
|
2002-08-07 18:56:55 +00:00
|
|
|
if ($user->teamid == $team->id) {
|
2004-11-21 18:56:30 +00:00
|
|
|
mysql_query("update user set teamid=0 where id=$user->id");
|
|
|
|
team_update_nusers($team);
|
|
|
|
page_head("Quit $team->name");
|
|
|
|
echo "You have been removed from <a href=team_display.php?teamid=$team->id>$team->name</a>";
|
2002-08-07 18:56:55 +00:00
|
|
|
} else {
|
2004-11-21 18:56:30 +00:00
|
|
|
page_head("Unable to quit team");
|
|
|
|
echo "Team doesn't exist, or you don't belong to it.\n";
|
2002-08-07 18:56:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
page_tail();
|
|
|
|
|
|
|
|
?>
|