user web: flag to send less information on team member XML requests (from Willy de Zutter).

svn path=/trunk/boinc/; revision=21780
This commit is contained in:
Rytis Slatkevičius 2010-06-20 08:35:36 +00:00
parent b8bbf607ad
commit 6c5fc14a23
3 changed files with 22 additions and 7 deletions

View File

@ -4419,3 +4419,13 @@ Charlie 18 Jun 2010
clientgui/
MainDocument.cpp, .h
Rytis 20 Jun 2010
- user web: flag to send less information on team member XML requests
(from Willy de Zutter).
html/
inc/
xml.inc
user/
team_email_list.php

View File

@ -86,25 +86,29 @@ echo"</user>
";
}
function show_team_member($user, $show_email) {
function show_team_member($user, $show_email, $creditonly = false) {
if ($creditonly && !$user->total_credit) { return; }
$cpid = md5($user->cross_project_id.$user->email_addr);
echo "<user>
<id>$user->id</id>
<cpid>$cpid</cpid>
";
if ($show_email && $user->send_email) {
echo "<email_addr>$user->email_addr</email_addr>
echo " <email_addr>$user->email_addr</email_addr>
";
}
echo "<cpid>$cpid</cpid>
<create_time>$user->create_time</create_time>
echo " <total_credit>$user->total_credit</total_credit>";
if (!$creditonly) {
echo " <create_time>$user->create_time</create_time>
<name>".htmlspecialchars($user->name)."</name>
<country>$user->country</country>
<total_credit>$user->total_credit</total_credit>
<expavg_credit>$user->expavg_credit</expavg_credit>
<expavg_time>$user->expavg_time</expavg_time>
<url>".htmlspecialchars($user->url)."</url>
<has_profile>$user->has_profile</has_profile>
</user>
";
}
echo "</user>
";
}

View File

@ -23,6 +23,7 @@ require_once("../inc/team.inc");
$xml = get_int('xml', true);
if ($xml) {
$creditonly = get_int('creditonly', true);
require_once("../inc/xml.inc");
xml_header();
$retval = db_init_xml();
@ -39,7 +40,7 @@ if ($xml) {
$users = BoincUser::enum_fields("id, email_addr, send_email, name, total_credit, expavg_credit, has_profile, donated, country, cross_project_id, create_time, url", "teamid=$team->id");
//$users = BoincUser::enum("teamid=$team->id");
foreach($users as $user) {
show_team_member($user, $show_email);
show_team_member($user, $show_email, $creditonly);
}
echo "</users>\n";
exit();