2004-01-06 22:09:19 +00:00
|
|
|
<?php
|
2008-08-05 22:43:14 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2004-01-06 22:09:19 +00:00
|
|
|
|
2007-10-07 19:27:59 +00:00
|
|
|
// Show results with pending credit for a user
|
2004-01-06 22:09:19 +00:00
|
|
|
|
2013-09-29 09:44:47 +00:00
|
|
|
// DEPRECATED - result.claimed_credit not used anymore
|
|
|
|
|
2007-04-29 19:57:18 +00:00
|
|
|
require_once("../inc/util.inc");
|
2007-10-28 15:03:14 +00:00
|
|
|
require_once("../inc/boinc_db.inc");
|
2007-04-29 19:57:18 +00:00
|
|
|
require_once("../inc/xml.inc");
|
|
|
|
|
2011-02-09 22:11:34 +00:00
|
|
|
check_get_args(array("format", "authenticator"));
|
|
|
|
|
2009-05-18 16:58:11 +00:00
|
|
|
BoincDb::get(true);
|
|
|
|
|
2007-04-29 19:57:18 +00:00
|
|
|
$config = get_config();
|
|
|
|
if (!parse_bool($config, "show_results")) {
|
|
|
|
error_page("This feature is turned off temporarily");
|
|
|
|
}
|
|
|
|
|
|
|
|
$format = get_str("format", true);
|
2004-07-02 19:17:53 +00:00
|
|
|
|
2007-04-29 19:57:18 +00:00
|
|
|
if ($format == "xml") {
|
|
|
|
xml_header();
|
|
|
|
|
2008-12-14 22:18:49 +00:00
|
|
|
$auth = BoincDb::escape_string(get_str('authenticator'));
|
2008-02-18 23:48:07 +00:00
|
|
|
$user = BoincUser::lookup("authenticator='$auth'");
|
2007-10-28 15:03:14 +00:00
|
|
|
if (!$user) {
|
2013-12-29 06:50:59 +00:00
|
|
|
echo "<error>".xml_error(ERR_DB_NOT_FOUND)."</error>\n";
|
2007-04-29 19:57:18 +00:00
|
|
|
exit();
|
|
|
|
}
|
|
|
|
$sum = 0;
|
|
|
|
echo "<pending_credit>\n";
|
2007-10-28 15:03:14 +00:00
|
|
|
$results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0");
|
|
|
|
foreach($results as $result) {
|
2007-04-29 19:57:18 +00:00
|
|
|
echo "<result>\n";
|
|
|
|
echo " <resultid>".$result->id."</resultid>\n";
|
|
|
|
echo " <workunitid>".$result->workunitid."</workunitid>\n";
|
2007-08-24 19:26:33 +00:00
|
|
|
echo " <hostid>".$result->hostid."</hostid>\n";
|
2007-04-29 19:57:18 +00:00
|
|
|
echo " <claimed_credit>".$result->claimed_credit."</claimed_credit>\n";
|
|
|
|
echo " <received_time>".$result->received_time."</received_time>\n";
|
|
|
|
echo "</result>\n";
|
|
|
|
$sum += $result->claimed_credit;
|
|
|
|
}
|
|
|
|
echo "<total_claimed_credit>".$sum."</total_claimed_credit>\n";
|
|
|
|
echo "</pending_credit>\n";
|
|
|
|
} else {
|
2004-01-06 22:09:19 +00:00
|
|
|
$user = get_logged_in_user();
|
|
|
|
$sum = 0;
|
2007-04-29 19:57:18 +00:00
|
|
|
|
2011-12-24 05:19:21 +00:00
|
|
|
page_head(tra("Pending credit"));
|
2004-01-06 22:09:19 +00:00
|
|
|
start_table();
|
2011-12-24 05:19:21 +00:00
|
|
|
echo "<tr><th>".tra("Result ID")."</th><th>".tra("Workunit ID")."</th><th>".tra("Host ID")."</th><th>".tra("Claimed credit")."</th></tr>\n";
|
2007-10-28 15:03:14 +00:00
|
|
|
$results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0");
|
|
|
|
foreach($results as $result) {
|
2007-04-29 19:57:18 +00:00
|
|
|
echo "<tr>\n";
|
|
|
|
echo "<td><a href=\"result.php?resultid=$result->id\">$result->id</a></td>\n";
|
2007-06-06 18:19:13 +00:00
|
|
|
echo "<td><a href=\"workunit.php?wuid=$result->workunitid\">$result->workunitid</a></td>\n";
|
2007-08-24 19:26:33 +00:00
|
|
|
echo "<td><a href=\"show_host_detail.php?hostid=$result->hostid\">$result->hostid</a></td>\n";
|
2007-04-29 19:57:18 +00:00
|
|
|
echo "<td>".format_credit($result->claimed_credit)."</td>\n";
|
|
|
|
echo "</tr>\n";
|
|
|
|
$sum += $result->claimed_credit;
|
2004-01-06 22:09:19 +00:00
|
|
|
}
|
|
|
|
end_table();
|
2007-04-29 19:57:18 +00:00
|
|
|
|
2011-12-24 05:19:21 +00:00
|
|
|
echo tra("Pending credit: %1", format_credit($sum));
|
2007-06-01 13:13:58 +00:00
|
|
|
page_tail();
|
2007-04-29 19:57:18 +00:00
|
|
|
}
|
|
|
|
|
2008-02-18 23:48:07 +00:00
|
|
|
$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit
|
2004-01-06 22:09:19 +00:00
|
|
|
?>
|