\n";
$generating_xml = true;
}
function xml_error($num, $msg=null) {
if (!$msg) {
switch($num) {
case -112: $msg = "Invalid XML"; break;
case -136: $msg = "Invalid ID"; break;
case -137: $msg = "Name or email address is not unique"; break;
case -138: $msg = "Can't access database"; break;
case -183: $msg = "Project is temporarily offline"; break;
case -205: $msg = "Email address has invalid syntax"; break;
case -206: $msg = "Invalid password"; break;
case -207: $msg = "Email address is not unique"; break;
case -208: $msg = "Account creation is disabled"; break;
case -209: $msg = "Invalid invitation code"; break;
case -210: $msg = "Invalid request method"; break;
default: "Unknown error"; break;
}
}
echo "
$num
$msg
";
exit();
}
function show_host_xml($host) {
echo "
$host->id
$host->create_time
$host->rpc_seqno
$host->host_cpid
$host->total_credit
$host->expavg_credit
$host->expavg_time
$host->domain_name
$host->p_ncpus
$host->p_vendor
$host->p_model
$host->p_fpops
$host->p_iops
$host->os_name
$host->os_version
$host->venue
";
}
function show_user_xml($user, $show_hosts) {
$cpid = md5($user->cross_project_id.$user->email_addr);
echo "
$user->id
$cpid
$user->create_time
".htmlspecialchars($user->name)."
$user->country
$user->total_credit
$user->expavg_credit
$user->expavg_time
$user->teamid
".htmlspecialchars($user->url)."
$user->has_profile
";
if ($show_hosts) {
$hosts = BoincHost::enum("userid=$user->id");
echo " $user->venue\n";
foreach ($hosts as $host) {
show_host_xml($host);
}
}
echo"
";
}
function show_team_member($user, $show_email) {
$cpid = md5($user->cross_project_id.$user->email_addr);
echo "
$user->id
";
if ($show_email && $user->send_email) {
echo "$user->email_addr
";
}
echo "$cpid
$user->create_time
".htmlspecialchars($user->name)."
$user->country
$user->total_credit
$user->expavg_credit
$user->expavg_time
".htmlspecialchars($user->url)."
$user->has_profile
";
}
function show_team_xml($team) {
echo "
$team->id
$team->create_time
$team->userid
".htmlspecialchars($team->name)."
$team->url
$team->type
$team->country
$team->total_credit
$team->expavg_credit
$team->expavg_time
";
}
?>