2002-08-07 18:56:55 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("util.inc");
|
|
|
|
require_once("team.inc");
|
|
|
|
require_once("db.inc");
|
|
|
|
|
|
|
|
db_init();
|
2003-03-19 21:01:32 +00:00
|
|
|
$user = get_logged_in_user();
|
2002-08-07 18:56:55 +00:00
|
|
|
|
|
|
|
$query = sprintf(
|
|
|
|
"select * from team where id = %d",
|
2003-03-21 04:38:55 +00:00
|
|
|
$_POST["id"]
|
2002-08-07 18:56:55 +00:00
|
|
|
);
|
|
|
|
$result = mysql_query($query);
|
2003-03-19 21:01:32 +00:00
|
|
|
if ($result) {
|
2002-12-16 21:41:41 +00:00
|
|
|
$team = mysql_fetch_object($result);
|
|
|
|
mysql_free_result($result);
|
|
|
|
}
|
|
|
|
require_founder_login($user, $team);
|
|
|
|
|
2003-03-21 04:38:55 +00:00
|
|
|
page_head("Removing users from $team->name", $user);
|
|
|
|
$nmembers = 0;
|
|
|
|
for ($i=0; $i<$_POST["ninactive_users"]; $i++) {
|
|
|
|
if ($_POST["remove_$i"] != 0) {
|
|
|
|
$query = sprintf(
|
|
|
|
"select * from user where id = %d",
|
|
|
|
$_POST["remove_$i"]
|
|
|
|
);
|
|
|
|
$result = mysql_query($query);
|
|
|
|
$user = mysql_fetch_object($result);
|
|
|
|
if ($user->teamid != $team->id) {
|
|
|
|
echo "<br>$user->name is not a member of $team->name";
|
|
|
|
} else {
|
|
|
|
$query_user_table = sprintf(
|
|
|
|
"update user set teamid = 0 where id = %d",
|
|
|
|
$_POST["remove_$i"]
|
2002-08-07 18:56:55 +00:00
|
|
|
);
|
2003-03-21 04:38:55 +00:00
|
|
|
$nmembers++;
|
|
|
|
$result_user_table = mysql_query($query_user_table);
|
|
|
|
echo "<br>$user->name has been removed";
|
2002-08-07 18:56:55 +00:00
|
|
|
}
|
2003-03-21 04:38:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
$new_nusers = $$team->nusers - $nmembers;
|
|
|
|
$query = "update team set nusers = $new_nusers where id = $team->id";
|
|
|
|
$result = mysql_query($query);
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2003-03-21 04:38:55 +00:00
|
|
|
page_tail();
|
2002-08-07 18:56:55 +00:00
|
|
|
|
|
|
|
?>
|