2007-07-27 18:30:10 +00:00
|
|
|
<?php
|
2007-11-07 17:23:29 +00:00
|
|
|
require_once("../inc/boinc_db.inc");
|
2007-07-27 18:30:10 +00:00
|
|
|
require_once("../inc/user.inc");
|
|
|
|
require_once("../inc/team.inc");
|
|
|
|
|
2007-10-26 21:14:35 +00:00
|
|
|
$xml = get_int('xml', true);
|
2007-07-27 18:30:10 +00:00
|
|
|
|
|
|
|
function show_delta($delta) {
|
|
|
|
global $xml;
|
2007-11-07 17:23:29 +00:00
|
|
|
$user = BoincUser::lookup_id($delta->userid);
|
2007-07-27 18:30:10 +00:00
|
|
|
$when = time_str($delta->timestamp);
|
|
|
|
$what = $delta->joining?"joined":"quit";
|
|
|
|
if ($xml) {
|
|
|
|
echo " <action>
|
2007-08-15 03:07:35 +00:00
|
|
|
<id>$user->id</id>
|
|
|
|
<name>$user->name</name>
|
2007-07-27 18:30:10 +00:00
|
|
|
<action>$what</action>
|
|
|
|
<total_credit>$delta->total_credit</total_credit>
|
|
|
|
<when>$when</when>
|
|
|
|
</action>
|
|
|
|
";
|
|
|
|
} else {
|
|
|
|
echo "<tr>
|
|
|
|
<td>$when</td>
|
2007-11-16 21:31:43 +00:00
|
|
|
<td>",user_links($user)," (ID $user->id)</td>
|
2007-07-27 18:30:10 +00:00
|
|
|
<td>$what</td>
|
|
|
|
<td>$delta->total_credit</td>
|
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$user = get_logged_in_user();
|
2007-11-07 17:23:29 +00:00
|
|
|
$teamid = get_int('teamid');
|
|
|
|
$team = BoincTeam::lookup_id($teamid);
|
2007-07-27 18:30:10 +00:00
|
|
|
if ($xml) {
|
|
|
|
require_once('../inc/xml.inc');
|
|
|
|
xml_header();
|
|
|
|
}
|
|
|
|
|
2007-11-16 00:26:48 +00:00
|
|
|
if (!$team || !is_team_founder($user, $team)) {
|
2007-07-27 18:30:10 +00:00
|
|
|
if ($xml) {
|
2007-11-16 00:26:48 +00:00
|
|
|
xml_error("-1", "Not founder");
|
2007-07-27 18:30:10 +00:00
|
|
|
} else {
|
2007-11-16 00:26:48 +00:00
|
|
|
error_page("Not founder");
|
2007-07-27 18:30:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($xml) {
|
|
|
|
echo "<actions>\n";
|
|
|
|
} else {
|
|
|
|
page_head("Team history for $team->name");
|
|
|
|
start_table();
|
|
|
|
echo "<tr>
|
|
|
|
<th>When</th>
|
|
|
|
<th>User</th>
|
|
|
|
<th>Action</th>
|
|
|
|
<th>Total credit at time of action</th>
|
|
|
|
</tr>
|
|
|
|
";
|
|
|
|
}
|
2007-10-26 21:14:35 +00:00
|
|
|
$deltas = BoincTeamDelta::enum("teamid=$teamid order by timestamp");
|
|
|
|
foreach($deltas as $delta) {
|
2007-07-27 18:30:10 +00:00
|
|
|
show_delta($delta);
|
|
|
|
}
|
|
|
|
if ($xml) {
|
|
|
|
echo "</actions>\n";
|
|
|
|
} else {
|
|
|
|
end_table();
|
|
|
|
page_tail();
|
|
|
|
}
|
2007-11-07 17:23:29 +00:00
|
|
|
|
2007-07-27 18:30:10 +00:00
|
|
|
?>
|