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");
|
2004-11-18 20:01:12 +00:00
|
|
|
require_once("../inc/email.inc");
|
2004-02-02 23:34:39 +00:00
|
|
|
require_once("../inc/team.inc");
|
2002-08-07 18:56:55 +00:00
|
|
|
|
2006-03-24 23:37:32 +00:00
|
|
|
$xml = get_int('xml', true);
|
|
|
|
if ($xml) {
|
|
|
|
require_once("../inc/xml.inc");
|
|
|
|
xml_header();
|
2006-09-06 20:56:55 +00:00
|
|
|
$retval = db_init_xml();
|
|
|
|
if ($retval) xml_error($retval);
|
|
|
|
$teamid = get_int("teamid");
|
|
|
|
$team = lookup_team($teamid);
|
2006-03-24 23:37:32 +00:00
|
|
|
if (!$team) {
|
2006-09-06 20:56:55 +00:00
|
|
|
xml_error(-136);
|
2006-03-24 23:37:32 +00:00
|
|
|
}
|
2006-03-30 00:45:24 +00:00
|
|
|
$show_email = true;
|
2006-03-24 23:37:32 +00:00
|
|
|
$account_key = get_str('account_key', true);
|
|
|
|
$user = lookup_user_auth($account_key);
|
2006-10-23 19:33:22 +00:00
|
|
|
if (!$user || $team->userid != $user->id || $teamid != $user->teamid) {
|
2006-03-30 00:45:24 +00:00
|
|
|
$show_email = false;
|
2006-03-24 23:37:32 +00:00
|
|
|
}
|
|
|
|
echo "<users>
|
2006-03-30 00:45:24 +00:00
|
|
|
";
|
2006-03-24 23:37:32 +00:00
|
|
|
$result = mysql_query("select * from user where teamid=$team->id");
|
|
|
|
while ($user = mysql_fetch_object($result)) {
|
2006-03-30 00:45:24 +00:00
|
|
|
show_team_member($user, $show_email);
|
2006-03-24 23:37:32 +00:00
|
|
|
}
|
|
|
|
echo "</users>
|
2006-03-30 00:45:24 +00:00
|
|
|
";
|
2006-03-24 23:37:32 +00:00
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2006-09-06 20:56:55 +00:00
|
|
|
db_init();
|
|
|
|
|
2006-03-24 23:37:32 +00:00
|
|
|
$user = get_logged_in_user();
|
2006-10-23 19:33:22 +00:00
|
|
|
$teamid = get_int("teamid");
|
2006-12-29 23:36:24 +00:00
|
|
|
$plain = get_int("plain", true);
|
2006-10-23 19:33:22 +00:00
|
|
|
if ($user->teamid == $teamid) {
|
|
|
|
$team = lookup_team($teamid);
|
|
|
|
require_founder_login($user, $team);
|
2002-12-16 21:41:41 +00:00
|
|
|
|
2006-12-29 23:36:24 +00:00
|
|
|
if ($plain) {
|
|
|
|
header("Content-type: text/plain");
|
|
|
|
} else {
|
|
|
|
page_head("$team->name Email List");
|
|
|
|
start_table();
|
|
|
|
row1("Member list of $team->name");
|
|
|
|
row2_plain("<b>Name</b>", "<b>Email address</b>");
|
|
|
|
}
|
2006-10-23 19:33:22 +00:00
|
|
|
$result = mysql_query("select * from user where teamid=$team->id");
|
|
|
|
while ($user = mysql_fetch_object($result)) {
|
2006-12-29 23:36:24 +00:00
|
|
|
if ($plain) {
|
|
|
|
echo "$user->name <$user->email_addr>\n";
|
|
|
|
} else {
|
|
|
|
row2_plain($user->name, $user->email_addr);
|
|
|
|
}
|
2006-10-23 19:33:22 +00:00
|
|
|
}
|
2006-12-29 23:36:24 +00:00
|
|
|
if (!$plain) {
|
|
|
|
mysql_free_result($result);
|
|
|
|
end_table();
|
|
|
|
echo "<p><a href=team_email_list.php?teamid=$teamid&plain=1>Show as plain text</a>";
|
|
|
|
page_tail();
|
|
|
|
}
|
2006-10-23 19:33:22 +00:00
|
|
|
} else {
|
|
|
|
error_page("You need to be the member and the founder of the team to edit team information.");
|
|
|
|
}
|
2002-08-07 18:56:55 +00:00
|
|
|
|
|
|
|
?>
|